Atom writes tree over mountpoint on Mac if samba server disconnects


#1

I’m editing a Python file stored on a samba server from Atom 1.18 on my Mac. It’s accessible via a path like /Volumes/(myvolume)/foo/bar.py.

If the samba server is disconnected when I next attempt to save the file, instead of indicating an error condition (as most editors do) when the underlying directory disappears, Atom instead just creates a directory tree under /Volumes/(myvolume) on the local disk and saves the file there. This is confusing at best, and prevents me from being able to re-mount the samba server without clobbering the newly-created directory tree.

Do others encounter this problem? Any suggested solutions? Selecting “Core Settings” -> “Close Deleted File Tabs” does not help.


#2

I feel like the underlying problem here is the Samba server disconnecting randomly without informing you, so you’re going about your business and trying to use it when it just disappears.


#3

In this particular case, the samba server is disconnecting due to a network disconnection when, for example, the computer is suspended – it’s not a random disconnect. The fundamental problem is that Atom seems to handle that case in a much more problematic way than other editors I’ve used.

Other editors typically just throw up an error dialog indicating that they cannot save in the desired path, and allow the user either to save in a different location or to try again later (when, perhaps, the path becomes available again because the server is reconnected). However, Atom just ignores the fact that the save location has disappeared and attempts to create a path with the same name – something that can cause significant confusion on Unix-like OS’s where a mounted volume looks very much like a directory.


#4

I don’t feel like Atom’s behavior is problematic. You are giving it a directory that you want this file to be in, and it’s not questioning you because of a little thing like the directory not existing. That’s how I want my programs to behave. And you are still telling Atom to save a file when the Samba server isn’t connected.

There are a few solutions. You could write a package to check whether the path still exists and alerts you. You could have Atom save your files constantly so that your computer never goes into suspension with unsaved files. You could submit a feature request to add a configuration option to alert before creating new folders on save.