Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Disappearing source files (again)

WSinc
New Contributor I
3,170 Views
This happens about twice a week, with no warning.

I am working on a project and when I click on an F90 file,
it says "could not find the path specified."

The GENMOD and the OBJECT files are still there, but no source code.
The source code is gone from the directory when I use Windows search.
Would windows 7 help cure this?

Other source code files are still present, however.
Where could it be putting the missing file?

Sometimes I can find it by looking at "recent document files," but VS 2008 cannot find it.
Other times it iscompletely lost.

I know you said that VS 2008 won't delete source code without my permission,
but this obviously IS happening. It only happens with small projects, maybe 2-3
source files.

So, does VS 2008 put backup files anywhere? Is there a way I can easily generate backups?

BTW, why does VS 2008 sometimes crash with "internal error?"
I send the report, but don't know if that does any good.
0 Kudos
19 Replies
mecej4
Honored Contributor III
3,169 Views
In a multi-tasking OS, more than one process can create, modify and delete files. I sometimes have a source file open in an editor (e.g., an assembly output from a compilation or a preprocessor output), and do compilations and use a stream editor at the command line. Sometimes, the file open in the text-editor buffer gets altered or deleted by another process. Most editors allow you to request that they monitor and notiffy you of such events.

I would not count on files created by another process to be preserved. Generated files fall into this category. It is reasonable for the compiler to purge old .mod files and _genmod files before starting a new run.

You can try to snoop out the process that is deleting your files by setting the read-only attribute on files that you anticipate to be targets of deletion. If the deletion fails and the process trying to do that gives an error message, you will know. Until you have found the culprit, of course, you should make backups of the files.

You can use a source code control system such as CVS, but that is too much in terms of overhead for small projects.

Would windows 7 help cure this?

Unlikely, since the most widely used OS of all-time (XP) would not have such a blatant bug in it remaining undetected after a decade of use worldwide.

why does VS 2008 sometimes crash with "internal error?"

That's easy to answer. We don't know how to make large programs error-free and at reasonable cost. The crashes are part of monitoring and healing. I'd rather experience the pain of a software crash with a pertinent message available to read than be faced with the result of silently ignoring programming errors with "default corrective action".
0 Kudos
Steven_L_Intel1
Employee
3,170 Views
There are many backup programs. Windows includes a rudimentary one that might meet your needs. At home I use a combination of Acronis True Image to do thrice-weekly backups of the system disk to another disk and a weekly backup to a NAS box. I also use Carbonite to do "cloud" backups of my personal files. If you are not doing any backups at all, you are living dangerously. An option I recommended to someone else is a Seagate Replica (this is a repackaging of a solution called ClickFree which you can also look for) that does continuous backups to a USB hard disk. It's very easy to configure and works in the background.

I am not aware of VS2008 deleting files on its own. Indeed, a Google search turns up many complaints of VS2008 making it hard to delete a file! You could also have disk structure corruption which can cause files to disappear - I suggest running CHKDISK.

If your development files are important, I recommend doing frequent backups. Windows 7 does have some nice features, including being able to look at earlier versions of files.
0 Kudos
IanH
Honored Contributor III
3,170 Views
Quoting mecej4
You can use a source code control system such as CVS, but that is too much in terms of overhead for small projects.

Perhaps, but I think anyone who does programming on a semi-regular basis should still consider such a system. The overhead is really only the initial setup and learning curve, once you've got the "infrastructure" in place then using version control system is probably less work than just using the normal windows fileystem on its own. I don't want to understate the upfraont cost, but there are many benefits beyond being able to recover mysteriously disappearing files.

There are plenty of options. Our little group uses subversion (svn) with the AnkhSVN Visual Studio integration.

Bill - Its very unlikely that Visual Studio would do this out-of-the-box without some sort of user coercion. I'd check that there's nothing astray with your project settings in terms of the files that are set to be cleaned; check the names of the output or intermediate files from compilation and linking steps; have a very close look at any custom build steps or scripts, or for that matter, any operation you might do that involves interacting with files or project structure. When you find such a file in "recent document files" (what exactly do you mean by that? I'm assuming its the collection of shortcuts to recently used documents available from the Window's start menu) where specifically is the file relative to where it should be?

The very few times I've experienced mysteriously disappearing source files were all associated with the proximity of an open bottle of red to my keyboard.

0 Kudos
WSinc
New Contributor I
3,170 Views
Well, I do use a backup program, I have Migo PC Backup and the Nero Suite.
But those are run usually at the end of the day. I run it (say at 7 PM)
automatically.


I tried Carbonite, but gave up when it tied up my computer for several days, so that I couldn't get any work done.



The problem is: The disappearing source files
only occur when I am trying to modify or edit them on the same day. They only disappear when
I access them with VS 2008.

I can't help wondering why this occurs when I use VS 2008 and nowhere else.
If there was a disk problem, it wouldn't be limited to just this situation.

The remark about some other process wouldn't apply here. If I am updating a source file,
then only VS 2008 would have access to it. The Fortran compiler attaches it only when it
needs to be compiled, rather than running in the background. Besides, why would a compiler delete the
source file it was trying to compile? Read - only access, right?

I am wondering if something weird happens when I set breakpoints or remove them (?)

0 Kudos
WSinc
New Contributor I
3,170 Views
I don't drink, so I can't take the blame for that - Normally when you delete a file, it's done via "Remove" in the project space, then you are asked if you want to just remove it or DELETE it entirely. Then it would go into the Recycle bin. ButI never get any interaction of that kind.

By "recent documents," I am referring to the Start window. It is weird that it sometimes CAN find a file there, but
the same file has disappeared from the project folder it was in.

I also check the Recycle bin, but nothing appears there either..... If the delete were deliberate, I
could recover it from that.
0 Kudos
anthonyrichards
New Contributor III
3,169 Views
Is the problem of files going missing ONLY with files with F90 or FOR or F extension?
Perhaps you should check for missing files immediately before AND immediately after your automatic daily back-up?

I am intrigued when you say that you have been able to locate such a 'missing' file using then 'recent document' list shortcut. Where does the short-cut take you? What program do you think creates the short-cut?
0 Kudos
jimdempseyatthecove
Honored Contributor III
3,169 Views
>>The disappearing source filesonly occur when I am trying to modify or edit them on the same day. They only disappear when I access them with VS 2008

Are you modifying the files from within VS?
-OR-
Are you using your favorite editing program?
-OR-
Both?

If using your favorite editing program, and if your favorite editing program is ill behaved (for this purpose), then it may be doing something like this

1) Open file to edit
2) Rename to temp file name
3) Create output file of same name as original input file
- you do your edits here but leave editor open -
....
In coordination with above, use VS to compile projects

Note, VS permits you to redirect editing to external editor. (i.e. editing within VS may be editing outside of VS supplied programs)

In the above situation, it is potentially possible to shutdown and/or exit your editor with your file(s)renamed asthe temp file(s) and the original filenames now being NULL files.

A second potential problem is if your nightly backups are really nightly restores.

A third issue, you are at a university and the university pollicy is to wipe student files

A forth issue, you are at a university and others are sharing the folder where your source files are located (and deleting them as unwanted files).

A fifth issue, you are running a "virtual computer" complete with "virtual hard drive" and the exit from virtual computer session does not preserve contents of the virtual hard drive.

It would appear that there is something about what you are doing, or the environment in which you are doing it, that is unknown to us here, and thus limiting our ability to assist you.

There may be one potential VS issue that you can easily try out:

Turn off parallel builds

Parallel build should not affect the situation, but on occasions I have see unexpected symptoms to appear with parallel build enabled.

Jim Dempsey
0 Kudos
anthonyrichards
New Contributor III
3,169 Views
Yep, we need more information. The fact that your binary .OBJ and MOD files remain unaffected strongly indicates a selection effect towards EDITABLE files!

How about writing a little program to run in the background that is given a short list of Fortran files to cycle through at intervals of time, using INQUIRE to inspect each files status in turn and to put up a message immediately one 'goes missing'?
0 Kudos
WSinc
New Contributor I
3,169 Views
In every case I am using the VS 2008 source code editor.
Only F90 files disappear, which is why I suspect the VS 2008 to be the culprit.
Sure I couldwrite that little program - - cycle thru the files.
Is there a way to get a list of files within a projeect folder from a user-written EXE?

So I would just cycle thru the F90 files within a project folder.
The problem is, though, that if I am editing a given F90 file, it
would not be able to OPEN it, or do the INQUIRE.

So how can I tell whether it is missing, or just being accessed elsewhere?
What would be nice is a way to autoimatically save F90 files elsewhere as I go along,
rather than having to use Windows Backup, or some other one-shot deal.

As far as I can tell VS 2008 does not place a .BAK anywhere. Maybe it should?
0 Kudos
reneeculver
Beginner
3,170 Views
I agree that on a properly designed multiuser system there should never be an unaccounted-for file.
I've been in multiuser systems for forty years almost 16 hours a day for about 40 years and I've never seen an unaccounted for file including Windows. Note that I said, "properly designed systemd". I been on VB for about 19 years and have never seen it.

Renee
0 Kudos
jimdempseyatthecove
Honored Contributor III
3,169 Views
>>The problem is, though, that if I am editing a given F90 file, it would not be able to OPEN it, or do the INQUIRE.

The FORTRAN OPEN has to include SHARED (or SHARE='DENYNONE').
IVF:

On Windows systems, the default is 'DENYWR'. However, if you specify compiler option fpscomp general or the SHARED specifier, the default is 'DENYNONE'.


>>As far as I can tell VS 2008 does not place a .BAK anywhere

VS edits in place (however it has a copious undo history).

Where is your project folder?
Would it be in the temporary internet files folder?

Jim Dempsey
0 Kudos
mecej4
Honored Contributor III
3,169 Views
"Where is your project folder?"
Would it be in the temporary internet files folder?
"

-- said Jim with a sardonic smile.


0 Kudos
krishnabc
Beginner
3,169 Views
I am not sure whether my case is similar to the OP. I lost all my files yesterday. I was left with only two Fortran files on which I was working (editing) in Visual Studio 2008. Not only the fortran files and project solution folders, but some other files and folders as wellwhich were there in that main folder. I can only thank myself that I had backuped the fortran project in the morning before making any modifications. But, I lost some other files and folders (which were not that important though). Other data in other files and folders are all right. I am not sure if my computer got virus attacked?? Usually my antivirus software is always enabled. Don't know what is happening.

I didn't delete anything. They are also not in Recycle Binfolder. I checked.

0 Kudos
reneeculver
Beginner
3,170 Views
What operating systems do you both use? What version of VS do you both have? What version of the Intel Software do you have?

Renee
0 Kudos
anthonyrichards
New Contributor III
3,170 Views
What operating system?
Are you using a partitioned drive?
Do you log in with different usernames?
Could something have changed your file permissions?

Windows 7 and Vista operate something called VirtualStore.
This allows control of access to folders and files and can restict access and file/folder visibility to specific users.
Perhaps you are having problems with this?

To take ownnership of folders and files, see this link:

http://www.blogsdna.com/2159/how-to-take-ownership-grant-permissions-to-access-files-folder-in-windows-7.htm
0 Kudos
jimdempseyatthecove
Honored Contributor III
3,170 Views
Another thing to look into is: Did you inadvertantly move the file(s) by clicking on the file name in either the solution explorer or window explorer while the mouse is in motion? IOW inadvertently perform a

Click(select) | drag | Unclick(drop)

When you intended to perform

Click(select) | Unclick(leave selected)

Or did you inadvertantly hit the delete key while file name selected (VS Solution or Windows Explorer).
(I think you answered this before)

Or, is someone messing with you (intentionally or unintentionally)?

Do you manage this project/solution using a combination of VS IDE and MAKE?
If so, is your MAKE file deleting the source file(s)?

Jim Dempsey
0 Kudos
krishnabc
Beginner
3,169 Views
Thank you all for your responses andyour speculations.

Your (Jim Dempsey) speculations may be right. I don't know. But, as far as I know, I don't think that I did something odd inadvertently. No, I just use VS IDE, not MAKE file.

Yes, I am using a partitioned drive. I just have 2 drives. One for OS and another for data/documents. I also have full administrative authority to my computer. Not sure about "virtual store". Will take a look on it.

Ok, details of my computer and compiler are:
OS: Windows 7 Professional, 32-bit
Processor: Intel Core i7 CPU 870@2.93GHz
VS 2008 version 9.0.21022.8 RTM
IVF compiler XE 12.0.2.154 [IA-32]

Let me explain what I was actually doing:

I wanted to remove the uses of one of the modules. I thought to use the compiler's error generating facility for this. Hence, I removed that module file from the project at first. I built the solution (F6). Got lots of error. Commented out those errors. This procedure is repeated for afew timesto comment out the codes associated with that module. It was all right until there. At some point, I got the error "PRJ0019" (or something like that - just one line error message, I forgot) when trying to build solution. Hence, I thought to clean the solution and rebuild. When I tried to rebuild, I could not. I checked the folder, oh God! Nothing was there. I am not sure whether the files were disappeared before cleaning or after cleaning. Or, some odd things happened inadvertently.

Note: I am not blaming the IVF. There could be some other possibilities as well, as many of you are speculating. But, 2012 happened to my project folder. One thing to add: I was also working in a word document concurrently.
0 Kudos
reneeculver
Beginner
3,169 Views
I have a feeling that VS is removing or deleting the files when you remove them. Did you look in your Recycle bin? Are you running recycling? Also check the directory itself with explorer and not VS.

By the way, I find Windows Disk Image backup...to be wonderful.

Renee
0 Kudos
jimdempseyatthecove
Honored Contributor III
3,169 Views
>>Hence, I thought to clean the solution and rebuild

This would seem that "Clean" produced the symptoms.

Note, Clean will delete previously build .MOD files and their associated .OBJ files (if any). But it should not delete the .F90 files that were used to build these files.

Thus, if you had a dependency on these .MOD files and/or their associated .OBJ files (if any), ***while your solution source files are no longer referencing these files ***, then the build (link phase)will complain about missing files (that have been removed from your project source lists). Note, you can add additional dependencies to your project files look on these property pages in your projects.

Make copy of your project folder(s) prior to Clean. Set diagnostics to verbose for everything, do Clean, look at Build logs (save copies), then Build All, look at build logs again. I do not know if Clean writes files deleted into Build Log (files deleted). Comparing folders (after clean but before build) will tell you what was deleted.

dir BackupProject\*.* /s/b > BackupProject.txt
dir Project\*.* /s/b > Project.txt
windiff BackupProject.txt Project.txt

Inspecting the Clean log files and build log files and relating this to files deleted may shed some light on what is going on.

Jim Dempsey
0 Kudos
Reply