Home Download Buy Blog Forum Support

why is atomic save useful?

why is atomic save useful?

Postby sfranky on Tue Mar 12, 2013 7:18 am

is there a particular situation where atomic saves are better than the current implementation?
sfranky
 
Posts: 96
Joined: Mon Oct 19, 2009 10:06 pm

Re: why is atomic save useful?

Postby adzenith on Tue Mar 12, 2013 5:44 pm

Atomic saves are preferable because you will never end up with a mangled file if anything untoward happens while saving.
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: why is atomic save useful?

Postby sfranky on Tue Mar 12, 2013 5:57 pm

got it thanks! (any drawbacks for atomic saving?)
sfranky
 
Posts: 96
Joined: Mon Oct 19, 2009 10:06 pm

Re: why is atomic save useful?

Postby jps on Tue Mar 12, 2013 9:34 pm

You can loose meta data about the file, such as extended attributes and resource forks. OS X and Windows both provide APIs to preserve the metadata, which Sublime Text uses, but these won't work in all scenarios (e.g., over some network drives), and there's no equivalent on Linux. You can also get into trouble if editing a file in a directory with strange permissions, e.g., if it's setup to allow modifying existing files, but not create new ones.
jps
Site Admin
 
Posts: 3066
Joined: Wed Mar 19, 2008 12:33 pm

Re: why is atomic save useful?

Postby sfranky on Wed Mar 13, 2013 6:38 am

thanks, much appreciated!
sfranky
 
Posts: 96
Joined: Mon Oct 19, 2009 10:06 pm

Re: why is atomic save useful?

Postby Shagshag on Mon Oct 07, 2013 5:21 pm

It also looses symlinks and that is very annoying.
Shagshag
 
Posts: 1
Joined: Mon Oct 07, 2013 5:19 pm

Re: why is atomic save useful?

Postby Barium on Tue Oct 08, 2013 8:46 am

Just remember that atomic save is notoriously bugged in Sublime Text (at least versions 2 and 3), and should not be used until the bugs have been fixed :)
Barium
 
Posts: 24
Joined: Wed Mar 09, 2011 1:40 pm

Re: why is atomic save useful?

Postby wbond on Fri Oct 11, 2013 2:07 pm

Barium wrote:Just remember that atomic save is notoriously bugged in Sublime Text (at least versions 2 and 3), and should not be used until the bugs have been fixed :)


Considering Sublime Text 2 doesn't even have the concept of atomic saves - you might want to take this statement with a grain of salt.
wbond
 
Posts: 527
Joined: Mon Feb 28, 2011 5:33 am

Re: why is atomic save useful?

Postby Barium on Wed Oct 16, 2013 2:29 pm

Typo from my point :) see these posts for a description of the problem:

viewtopic.php?f=3&t=12947&p=50695
viewtopic.php?f=3&t=12660&start=0
Barium
 
Posts: 24
Joined: Wed Mar 09, 2011 1:40 pm

Re: why is atomic save useful?

Postby frou on Thu Feb 27, 2014 2:41 pm

Just for the record: disable this trick in preferences if you want file updates to be visible to concurrent processes by normal means.

i.e. with the default setting, another process that has open(2)'d a file you then open, edit and save with Sublime won't see those changes because they're made to a different underlying file.
frou
 
Posts: 49
Joined: Sun Jul 31, 2011 11:26 am


Return to General Discussion

Who is online

Users browsing this forum: BugFix, jps, Ospin and 46 guests