Files disappeared after clearing Mac Trash

I have had a disappearing Scrivener file happen to me twice now. I will try to explain as easily & shortly as I can.

I am using Scrivener 2.2 on two different Macs – a G5 Tower with Snow Leopard 10.5.8 and a new Mac Book Pro with Lion 10.7.4. The G5 Tower is hard wired to the House’s network while the laptop is wirelessly connected.

I sometimes manually back-up an open Scrivener file to a Kingston DT 109 USB drive if I am leaving the program on, on the G5 Tower, and slipping away from the desk for a few minutes (I live in a rural area with frequent losses of electrical power so I want to be sure of having my latest work.)

If I want to work somewhere other than my office I use the Mac Book Pro (laptop) so I copy the latest file version from the G5 Tower, onto the USB, then to the Pro. A few times now I have tried to open this copied, latest version – BUT a screen flashes on which reads something to the effect that I have “the file open on another computer and Scrivener can only work on one original document at a time, continuing may corrupt the document… If you want to continue with this document please make a copy and work from that.” (or words to that effect.)

Once I had left the document open on the G5 Tower so I assumed the Mac Book Pro was seeing this condition via the house network. Another time, when the G5 Tower document was not open I figured it was because I had copied the document from my hard drive file to the USB while the document was still open on the computer (vs. copying the document to the USB after closing down the program.) In any case, neither of these situations resulted in any lost files.

The first disappearing file (a book of 300 pages) was when I had been using Scrivener for only a week so I thought I had made some fatal error. This second time I have started writing this description right away so I can describe the circumstances.

The issue is made more complicated, I believe, as the Kingston USB can only be truly erased by emptying the computer’s Trash with the USB plugged in, not by simply deleting files off the USB itself (files look like they are deleted but you do not get the actual byte space back.)

OK, now to the issue. Today I transferred my G5 Tower working document file (copied to the USB) from the USB to my Mac Book Pro so I could work outside. In opening the file I received the window that “you cannot work on a document on one machine when it is open on another…” so I let the program create a copy (a new file title with a “1” appended) even tho I knew the program was not still open on the G5 Tower. Later in the day, I transferred this new file doc back to the G5 Tower when it was time to work inside. The file (mostly text) is only 3.9 MB but took forever to copy to the same Directory/Folder where the original file is located – the first sign that something was amiss. Thinking that perhaps the USB was getting full (tho it is far from) I decided to empty the Mac Trash – the only way to recover bytes on the Kingston. I should mention that the original file (without the “1” was also still on the USB drive.)

In securely emptying the Trash, it made not only the original file disappear from its Folder (on the G5 Tower), but also the G5 Tower automatic back-ups (and all the other unrelated Scrivener document back-ups, as well) and they are in an entirely different Directory/Folder! I have done this Trash emptying before without this happening , BUT not when the “error” message about “only one copy of a document allowed open” had displayed. This wipe-out did not, fortunately, erase the copy (the one with the “1” added to the title) I had made and moved to the G5 Tower hard drive. (I did lose the 300 page book the first time this happened because I did not have a back-up with a different name – so now I know it was not my befuddled brain that was responsible.)

I know it will probably not be possible for you to duplicate this issue as it may only happen with the use of a Kingston drive but I thought I’d bring it up.

Personally, I would NEVER copy any file that is open. I just look on that as good practice when using computers. Programs sometimes hold information in RAM, or they write information to disk when closing a file, so copying anything that is open runs the risk of you ending up with an incomplete or corrupted file.

Tech support will have to answer your specific questions, but I wouldn’t be surprised if that were not a part of the problem. I have a vague recollection to the effect that Scrivener writes a file to disk when closing the project, and the lack of that (I think) might result in Scrivener thinking that the project is open elsewhere. I assume that using the proper “File > Back up” command from inside Scrivener gets around that problem.

Martin.

The “this project is open” message can merely just mean that the project was copied while it was open, so that the lock file inside it is present in the copy when it is opened. If you know that the project is not open somewhere else, it’s safe to ignore it - it’s just better for Scrivener to give a false-positive in this case than not to give a warning when one might be needed.

As for the data loss, as you ascertain, it’s very difficult to say what is going on there. What I can say is that it is very unlikely that Scrivener is responsible, seeing as Scrivener at no point ever deletes projects from disk. There is not a line of code in Scrivener that could do that. If something disastrous happened in Scrivener and it went haywire deleting things, you would still end up with the .scriv file itself (which is really a file package, a special sort of folder), with files inside missing and thus the project refusing to happen. (Although I hasten to add that even this is unlikely ever to happen - we had occasional data corruption problems in 1.x and I worked with Apple technical support to ensure this sort of thing was well-guarded against in 2.0, since when we have had no users with any such data loss - and I should add that there were only isolated cases even with 1.x.) But there is no way Scrivener can delete the .scriv file itself - only the user can do that via the Finder, or third-party tools.

Of course, it would be foolish of me to say that I am 100% certain Scrivener isn’t responsible, because I’m human and my code is therefore fallible, as is Apple’s, but I would say that I’m 99% sure, from what you tell me, that Scrivener is not deleting your files in this situation.

Have you done a Spotlight search on the project name, or just on the “.scriv” extension, to ensure that the file is not lurking somewhere?

All the best,
Keith