On Sat, Nov 24, 2018 at 10:11:37PM -0500, Richard Kimberly Heck wrote: > > I blame global warming. > > > I do not believe LyX sets file permissions itself. The write routine > simply uses basic_ofstream, which just creates the file using the > current umask, or whatever other default permissions are in place.
It's actually not that simple. It's in LyX for years now and I believe it traces back to times when we start getting the reports that on some ext4 filesystems power outage resulted in .lyx files truncated to zero. The underlying issue was that some smart kernel devs suddenly decided that syncing journal record (eg. record "rewrite of file") and writing the content of file itself are not actions which necesarilly need to happen at the same time and the time window between could be actually quite big (tenths of seconds). If in that window of oportunity you lost power the only thing left on your harddrive was empty .lyx file (just after innocent save). So what lyx start doing after that is actually more complex that just saving file - there is hidden movement charade of files behind the scenes when you save the file to avoid the problems mentioned above - and probably somewhere in this game the permissions go south... That would also likely explain why there is chaos with different permissions on your drives and newly created file do look different than resaved ones. Pavel