Ticket #3485 (new enhancement) — at Initial Version
change in src/vfs/extfs/extfs.c
Reported by: | Nicolas Rybkin | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Future Releases |
Component: | mc-vfs | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
I want this change in src/vfs/extfs/extfs.c:
add to extfs_fstat() lines between BEGIN and END
static int
extfs_fstat (void *data, struct stat *buf)
{
struct pseudofile *file = (struct pseudofile *) data;
BEGIN:
struct stat tmp_stat;
if (!stat(file->entry->inode->local_filename,&tmp_stat))
{
file->entry->inode->mtime = tmp_stat.st_mtime;
file->entry->inode->atime = tmp_stat.st_atime;
}
END
extfs_stat_move (buf, file->entry->inode);
return 0;
}
So extfs script can set atime and mtime in copyout, and they will be set in the properties of destination file.
Why do I need this: I need to use 3 bytes to store some data related to file, I decided to store them in st_atime. As I learned if atime is bigger than mtime, atime won't be changed until mtime is changed. So my script sets atime of a copied out file to 0x7Fxxxxxx.