Author Topic: MPLAB "File has changed" message with files on a Samba share  (Read 2855 times)

0 Members and 1 Guest are viewing this topic.

Offline David_AVDTopic starter

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Not sure if this really belongs here, but it is an issue that is confined to MBLAB for me.

I'm using the most recent version of MPLAB on Windows 7 and the project files are stored on a Samba share (Debian server).  I had the same issue with Windows XP.

MPLAB often complains that one or more of the source files have been changed (and asks if I want to reload) even if I switch focus away and back to MPLAB.  Of course if the file is not saved, accepting the reload option blows away the changes!

I know that this is caused by a file time conflict between Windows and the Samba server, but have never managed to solve it over the past few years.  Are there any Linux experts out there that can offer some advice on how to solve this?

Moving the project files onto a local drive is not really a solution I want to go for, as I do jump around on different machines during the course of the day.  That's the main reason for hosting them on the Samba server.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9923
  • Country: nz
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #1 on: May 22, 2013, 09:30:16 am »
I'm not sure what it's called, but i do remember there's a config setting for which file date/time is supplied to windows by samba.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #2 on: May 22, 2013, 10:36:17 am »
maybe one of these two settings in your samba smb.conf file

Code: [Select]
dos filetime resolution

    Under the DOS and Windows FAT filesystem, the finest granularity on time resolution is two seconds. Setting this parameter for a share causes Samba to
 round the reported time down to the nearest two second boundary when a query call that requires one second resolution is made to smbd.

   This option is mainly used as a compatibility option for Visual C++ when used against Samba shares. If oplocks are enabled on a share, Visual C++ uses
two different time reading calls to check if a file has changed since it was last read. One of these calls uses a one-second granularity, the other uses a two
second granularity. As the two second call rounds any odd second down, then if the file has a timestamp of an odd number of seconds then the two
timestamps will not match and Visual C++ will keep reporting the file has changed. Setting this option causes the two timestamps to match, and Visual C++
is happy.

    Default: dos filetime resolution = False

dos filetimes

    Under DOS and Windows, if a user can write to a file they can change the timestamp on it. Under POSIX semantics, only the owner of the file or root may
change the timestamp. By default, Samba runs with POSIX semantics and refuses to change the timestamp on a file if the user smbd is acting on behalf of is
 not the file owner. Setting this option to True allows DOS semantics and smbd will change the file timestamp as DOS requires.

    Default: dos filetimes = False

dos filetime resolution seems promising.. perhaps MPLAB does sometime similar to VC++
 

Offline David_AVDTopic starter

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #3 on: May 22, 2013, 11:54:52 am »
Yeah, tried various combinations of those settings over the years with no luck.

I may just have to move all projects over to the SVN system and use local (on the client PC) copies of the projects.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26868
  • Country: nl
    • NCT Developments
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #4 on: May 22, 2013, 02:29:09 pm »
The latter is a much better solution. Working from a network share always gives weird side effects.

I lost some very important files because the sysadmin didn't upgrade the server so there was no room to store the files. The IDE I used at that time wrote zero length files so effectively deleting the entire project. To add to the disaster the sysadmin didn't really worked out the backup scheme. He used 7 tapes for daily backups and one tape for a monthly backup. This meant he could go back only 7 days which caused my project to have dissapeared...
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline David_AVDTopic starter

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #5 on: May 22, 2013, 09:18:55 pm »
I already use SVN for new projects, so migrating the (100's of) older ones will not take that much effort.  A fix for the file time bug would have been nice in the meantime, but I can move projects into SVN as I need to anyway I guess.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #6 on: May 22, 2013, 11:59:55 pm »
Could the problem be samba server time is different from your windows computers time? Your samba server might not be using NTP or a different time server from your windows computers?

You could also be hitting a linux UTC time to windows utc time problem. Have you looked at the MBLAB reported errors?

C






 
 

Offline David_AVDTopic starter

  • Super Contributor
  • ***
  • Posts: 2806
  • Country: au
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #7 on: May 23, 2013, 12:09:17 am »
There's no "MPLAB errors" as such.  Just the annoying "file has changed" pop-up.

I opened the current project to my desktop today (via SVN) and no issues of course.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #8 on: May 23, 2013, 01:08:51 am »
To me, if MPLAB pops up a message "file has changed" an that is not true then it is a program error.

C
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26868
  • Country: nl
    • NCT Developments
Re: MPLAB "File has changed" message with files on a Samba share
« Reply #9 on: May 23, 2013, 01:25:14 pm »
I have the same problem with other IDEs and software. Its just one of the mysterious ways Windows works.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf