Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached ctimes/mtimes are not updated after altering them. #96

Open
agusdallalba opened this issue Sep 28, 2014 · 0 comments
Open

Cached ctimes/mtimes are not updated after altering them. #96

agusdallalba opened this issue Sep 28, 2014 · 0 comments

Comments

@agusdallalba
Copy link

After you change a file's modification time (for example using touch) a later stat doesn't reflect this change—the ctime/mtime value seems to be cached. Actually modifiying the file does work as I expect. Here's an example:

$ gdfs -d .cache/gdfs /tmp/gdfs/
$ cd /tmp/gdfs
$ rm test
rm: cannot remove 'test': No such file or directory

Now let's make a file called 'test':

$ touch -t test
$ stat test
  File: 'test'
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 26h/38d Inode: 2           Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1000/ username)   Gid: (  100/   users)
Access: 2014-09-27 23:38:12.958362102 -0300
Modify: 2014-09-27 23:38:01.000000000 -0300
Change: 2014-09-27 23:38:01.000000000 -0300
 Birth: -

So far so good. Now let's change it and pretend it's 2014/Jan/01 at 00:00:

$ touch -t 201401010000 test
$ stat test
  File: 'test'
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 26h/38d Inode: 2           Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1000/ username)   Gid: (  100/   users)
Access: 2014-09-27 23:39:55.063636064 -0300
Modify: 2014-09-27 23:38:01.000000000 -0300
Change: 2014-09-27 23:38:01.000000000 -0300
 Birth: -

Only the access time has changed. However in the Google Drive website the file appears correctly as 'Modified 1 Jan by me'. And after remounting the times are correct:

$ cd ..; fusermount -u /tmp/gdfs; gdfs -d .cache/gdfs /tmp/gdfs/; cd /tmp/gdfs
$ stat test
  File: 'test'
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 26h/38d Inode: 2           Links: 1
Access: (0666/-rw-rw-rw-)  Uid: ( 1000/ agustin)   Gid: (  100/   users)
Access: 2014-09-27 23:42:20.539596080 -0300
Modify: 2014-01-01 00:00:00.000000000 -0300
Change: 2014-01-01 00:00:00.000000000 -0300
 Birth: -

touching the time again yields the same result. An actual modification to the file works as expected without remounting:

$ echo '' > test
stat test
[...]
Modify: 2014-09-27 23:44:34.000000000 -0300
Change: 2014-09-27 23:44:34.000000000 -0300
 Birth: -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant