Author Topic: "Another application has modified the following file" but file hasn't changed  (Read 13505 times)

jquinn

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Hi,

A developer in my group has run into a strange problem with SlickEdit.  He has a file open (with rw permissions).  He then starts a script to compile all his code (outside of SlickEdit).  While his code is building he gets a popup indicating that "Another application has modified the following file... Do you wish to reload it" for the file he was editing. However, the build scripts will only read this file, they will not modify it.  I've verified that the file did not change nor did the timestamp.  Does anyone know what logic SlickEdit uses to determine that a file has changed?  The file is a ClearCase element if that makes any difference.  Thanks!

ScottW, VP of Dev

  • Senior Community Member
  • Posts: 1471
  • Hero Points: 64
We just check to see if the date and time are different. In the next release we are introducing an option to always diff the file. As long as the timestamp is the same we should be good. I wonder if ClearCase is somehow changing the file so that it still has the same date/time but our file handle is stale.

opello

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
I ran into this problem today, and solved it using:
set_var def_filetouch_checking
with a value of 1.

According to the help, it does "extra checking" (in SlickEdit 2008).

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
I'm experiencing this problem in Slickedit 2008 (v 13.0.2).

I tried setting "def_filetouch_checking" to "1", and it doesn't help.

In my case, the file is located on a UNIX server that is shared via SAMBA.

The timestamps between my Windows machine running slickedit, and the UNIX server are very close, within 1 second.

I modify the file in the editor, and save it.  After I go and modify some other files, but then come back to this one, it says another application has modified it, which is not true.  It is very, very annoying.

Can someone describe how does Slickedit perform the timestamp checking in detail?  For example, when a file is saved, does it use the time on the PC that the file was saved as the time to check against?  I think it would be smarter for slickedit to perform the following:  1) save the file, 2) retrieve the time stamp from the saved file using the filesystem (such as using the "stat" function in C), and save it, 3) compare the current time stamp of file (using stat function) against the timestamp that was retrieved right after the file was saved.

If I could get this information as how Slickedit determines that another application modified the file, it could help me to find ways to avoid this problem, which is very very annoying when I am editing lots of code, it happens every time I save a file, and I like to save very often.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2897
  • Hero Points: 153
Hi,

A developer in my group has run into a strange problem with SlickEdit.  He has a file open (with rw permissions).  He then starts a script to compile all his code (outside of SlickEdit).  While his code is building he gets a popup indicating that "Another application has modified the following file... Do you wish to reload it" for the file he was editing. However, the build scripts will only read this file, they will not modify it.  I've verified that the file did not change nor did the timestamp.  Does anyone know what logic SlickEdit uses to determine that a file has changed?  The file is a ClearCase element if that makes any difference.  Thanks!

Does it always behave this way for this file, or if you restart the editor does it stop?  Does it only happen with ClearCase files?

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
It always happens this way, even if I restart the editor.  It happens for any file on my SAMBA UNIX share, regardless of whether or not it is a clearcase element.

jonfec

  • Community Member
  • Posts: 6
  • Hero Points: 1
Has anyone ever figured out what is causing this issue? Some developers are seeing this at my site and it is quite annoying. I have not been able to pinpoint what the problem is as of yet and was wondering if anyone else has gotten to the root of the issue. The tweaks mentioned here and in other discussions seem to help mask the issue somewhat but the underlying issue still remains.

Thanks!

yur1

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
I ran into this problem today, and solved it using:
set_var def_filetouch_checking
with a value of 1.

According to the help, it does "extra checking" (in SlickEdit 2008).

Hey, we just ran into ths problem today.
We're editing files from Windows, but building on a VMware Linux virtual machine. After upgrading to the latest VMware, we couldn't get the clocks to stay synchronised to within 15s for more than a couple of minutes. Looks like VMware uses a soft-clock.

Setting the above variable to 1 sorted it.  ;D

Cheers,
Yuri.

Jonathan Griffitts

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
I'm seeing behavior like this in Windows XP pro when the files are on an offline folder using the Windows "offline files" feature.  This only happens when operating offline, when resynchronized online the problem disappears.

The problem is partly fixed by setting def_filetouch_checking.  The reload warning goes away but I still get a "Replace existing newer file?" warning when saving the file.

I investigated the problem a little bit.  Somehow p_date_time is getting out of sync with _file_date(), and I don't really understand why.  In macros/files.e the def_filetouch_checking fixes things in function _ReloadCurFile() but something similar would need to be done in save() near the call to overwrite_newer()

I would consider trying to fix the save() function myself if nobody has done it yet.

Jonathan Griffitts

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
To follow up on my own note:

I looked into this some more this weekend, to see why offline files cause these kinds of problems.  What I determined was that when an offline file is written, it takes about 10 seconds after the file is closed before the file modification timestamp is updated.  During that 10 second period, SlickEdit (and other editors) can get confused about the state of the file.

It only happens when working offline.  After reconnecting to the network and syncing files, everything works normally.

This is on Windows XP Pro.  I tried various Google searches to try to learn more, but couldn't find any mention of this behavior.

TimB

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Re: "Another application has modified the following file" but file hasn't changed
« Reply #10 on: September 14, 2010, 02:52:20 PM »
I have this problem also -- I'm using SlickEdit 12 on Windows to edit Linux files (.c and .h) using Samba.  This problem appeared after upgrading my Linux from Fedora 6 to 10.  I've syncd my clocks as best I can (~ < 1 second diff).  I would like to try using the "set_var def_filetouch_checking" to 1 but I don't know "where" do I type this?  :-[   


Thanks,

--Tim

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: "Another application has modified the following file" but file hasn't changed
« Reply #11 on: September 14, 2010, 04:53:22 PM »
Type it at the SlickEdit command line.  In most keyboard emulations hit <Esc> to get to the SlickEdit command line.  Or click on the left blank area of the status bar.