Your comments

Tried the apple optimisation recommendations from

https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X

and it makes no difference. Symbolic links still replaced with regular files both using Sublime Text and Text Edit. 


So people need to tread with care on any system using symbolic links and these editors. 

Its a fairly vanilla samba file, below is all thats left after I removed the comments.

That surprised me because I had tuned it for the Mac. Probably those settings got lost in some Ubuntu update, so this is proving to be a useful session. 

I will reapply the advice here 

https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X

and report back on if it is still misbehaving after Samba is optimised for Mac clients. 

[global]

log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
server role = standalone server
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

pam password change = yes
map to guest = bad user
ntlm auth = yes


[Data]
comment = "Cube Data Area"
path = /home/data
public = no
writable = yes
printable = no
browsable = yes
# needed for osx access
posix locking = no
valid users=jeremy julia

[homes]
browsable = yes
writeable = yes


[WebSpace]
comment = "Cube Web Server Files"
path = /var/www
public = no
writable = yes
printable = no
browsable = yes
# needed for osx access
posix locking = no
valid users=jeremy julia adrian clari

Correction. 
It turns out Text Edit and Xcode break the link for files on a samba share, but preserve it and write to the linked file when the files are local. 

Only Sublime Text behaves consistently and retains the link when saving both local and network files. 

Apples Text Edit and Xcode, as well as Sublime Text preserve the links. Textastic is the first thing I have seen that recreates the file from scratch. It never occurred to me that this might happen and was something I needed to check for. 


I only spotted the problem because I noticed git reporting a file type change when I did the check in. I wasn't expecting to see that and fortunately stopped to investigate. 

Its on a Mac and I am editing files via a LAN connection to the web server. It's a samba share exported by the web server running Linux, Ubuntu 18.04.5 LTS to be specific. 


I notice the situation is handled fine by Textastic if the files are on a local drive. There it does preserve the links. 
It appears Textastic handles the process of saving differently if the target is on a network share. 

The convenience of being able to edit any file on a remote machine you can ssh into like it was on your box, that often drags me off from Mac to my iPad, where there are a couple of editors that offer the convenience. Yet not a single Mac program does it as far as I can tell. A gap in the market right there, just waiting for you to own it Alexander. 


It would be useful for everyone who uses a Mac and maintains a web site or other server. Wonder how many people there are in that situation? Quite a lot I would guess.

I get the 'you can bolt this together with FTP client X, use file update events' argument, but thats not happening for editing files on an active server. It's got to be dependable. Which for me means one guy/company in control of the complete stack, testing it all as one product.