The saga of the disappearing source files (revisited)

The saga of the disappearing source files (revisited)

Apparently, Microsoft has not corrected the problem.

Occasionally, I see a source file disappear from the Solution list, but it's still there,
where I can recover it by adding "exisitng item."

But sometimes it disappeared entirely, nowhere to be found even when I go OUTSIDE the VS
environment. Today, for example, I started to open a NEW item, but chamged my mind. Not only did it save what I had, even when I said "cancel." it put a time tag on it of LAST YEAR.

And then a source file I had open for editing disappered. There was no way to recover it.

Now you would think that if a file were DELETED, it would be in the TRASH bin at least. But not even there was it to be found.......

Whay can't they at least make a BACKUP file of what we are editing? Every other package I have ever seen does that.

14 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

To further add to this weirdness -

Sometimes when I try to edit a file, it won't let me save it as a different file name.

An example would be if I have a subroutine and want to make a slightly different version of it.

The "save as" option is grayed out. So the only way to save a different version is
to close the VS environment, then reopen it.

This problem seems to have occurred in recent versions. A bug introduced by changes they made.

Why would they disable the "save as" version, anyway?

You weren't by chance debugging at the time? "Save as" is not available when the debugger is active.

You can tell if you are in debugging mode by the presence of additional debugging windows, and specifically by the Debug > Stop Debugging menu option being available.

I was wondering about that -
but some files CAN be saved with "save as" even while debugging.
So I have no reason to think that the feature is completely disabled.
I played with it - and "s'top debugging" does not change anything.

To add further to the drama; it told me a file was present in the
solution set, even when the file is not listed there.

So I think it's somehow losing track of which files are present or otherwise.
That's why it discards files that it thins are gone, and they are lost.

But as I said earlier, a simple fix would be to make a backup of any file that
is being edited, rather than discarding it until it is stored.

My experience is that when you edit a file, no changes are made to the original file until you save it. I have never seen the original deleted.

Retired 12/31/2016

You are using VS2010? How did you get the Save As menu item to be enabled (not greyed out) when debugging? I couldn't do that here with some simple test cases.

VS2010 has an auto-recover facility, which saves "unsaved" changes every couple of minutes in case of a crash (it is not a general backup facility). Do you have that turned on?

I think some screenshots and detailed explanation of exactly what you were doing when you get some of these error messages or observe these behaviour might help. I've never experienced anything like what you have described, despite "living" in Visual Studio during work hours.

Hi Ian;Maybe in my case the automatic save is not enabled.So, where do I turn that on, just to make sure?Unfortunately, screen shots won't show the problem,since I can't screen shot something that disappeared.I don't get ANY warning or error messages, it just happens.In other words, I go back to the original file I was editing,and it's nowhere to be found.If it's deleted, why isn't it in the TRASH bin? It might be helpful to find out exactly what VS 2010 does with a file when you open it for editing.Have you ever exprienced a source file disppearing from the Solution Space list,aside from whether it was recoverable?Generally the ones that disappear are those that I was editing, but are NOT in current focus, i.e.the tab is on another item.If you'll pardon my "soap box," I still think making a .BAK from .F90 when open for editing would be a simple fix.

Tools > Options, tnen Environment > AutoRecover. This is not a generic backup utility - it is just in case VS crashes. I'm not aware of a general backup facility for VS, but one could probably be written using the macro facilities.

I have never experienced files disappearing from the hard disk, despite using VS for a good decade or so. In previous VS versions and possibly only with other project types (C++) it was possible to "exclude" files from a project and effectively made the file hidden within the solution explorer. I did that accidentally once or twice (by accidentally selecting the wrong menu item) and getting the file to show again was a little tricky. But I don't think that's something that's relevant to fortran projects under VS2010. In your case I think there is something else happening on your system that is interfering.

Typically it is only when you use the Explorer shell (explorer.exe - which provides your Windows desktop and the various file manager style windows (explorer.exe) that "deleted" files are moved into the recycle bin. When applications directly delete a file (using the base operating system's API rather than the shell's API) the file is not moved into the recycle bin (for example, cmd.exe's del command does not move files to the recycle bin).

Do you use a source code versioning system, like subversion or CVS? If not I strongly recommend that you consider using one, even if you are only an occasional programmer. Good quality tools are available for free, and while there is still a bit of a learning curve there are Visual Studio add-on's that make them pretty easy to use. Once a file has been "checked in" to such a system it takes some quite special effort to obliterate it!

I was wondering if this could be caused by anti-virus software.
But usually this would manifest itself by being unable to attach a file,
if the AV software has grabbed it first. Sometimes I do experience a problem
doing a build which I think is caused by the AV package.

So, what does the VS package actually DO with a file when it is being moved into memory for
editing? If it's in "limbo" then having it just in memory is an open invitation to lose it
permanenly, perhaps? As I said earlier, just about every editing package I have ever seen
makes a temporary backup of any files moved into memory, to forestall a problem like that.

The problem seems to be aggravated by opening another tab while some other file is open for editing. I assume then, that any files open for editing are just residing in memory, not on the hard drive.

Anyway, if you know where I can get a file versioning system like you mentioned, I will take a hard look at it.

Another possibility would be a BATCH file that runs every hour or so to make copies of F90 files in the background.

VS reads the file into memory. The original file is left untouched until you save. All changes are done in the memory copy.

You may want to consider a good backup solution - you should be backing up your system anyway.

Retired 12/31/2016

I do back up everything on a continuous regular basis, using MyBook, but
even though it does it continuously, the file disappears before MyBook can access it.

I do also use a CTL-shift-S to save everything, but apparently not often enough.

If the file is "left untouched," why would it disappear?

If there was a SURE way to make it happen, I would describe that.
You don't use remorte assist, so there is no way to have anyone look at my system
environment to see what's going on.

Yes, we do use "remote assist" when appropriate, but if you can't reproduce the problem at will, I'm not sure what that would buy us.

My first guess as to why the file disappears is that you have some underlying issue on the system such as disk structure corruption.

Retired 12/31/2016

That was one of the first thing I considered, but I
don't understand why I would only see this during
the usage of VS 2010.

Otherwise, I would see it it other usage environments.

Why would a source file vanish from the Solution space
anyway? Even if I can recover it, it seems rather weird.

The next time you see this happen, please make a copy of the project .vfproj file and attach it here, noting the name of the file that disappeared from the project. I will note that the behavior you describe is exactly what would happen if you selected a file in the solution explorer, pressed Delete and then said to delete the file. I am sure that's not what you are doing, but to have the file disappear AND be removed from the project is quite suspicious.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today