Ticket #3485 (new enhancement)

Opened 9 years ago

Last modified 8 years ago

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 (last modified by andrew_b) (diff)

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.

Attachments

extfs.c (48.7 KB) - added by Nicolas Rybkin 9 years ago.
extfs.c.diff (234 bytes) - added by Nicolas Rybkin 9 years ago.

Change History

Changed 9 years ago by Nicolas Rybkin

Changed 9 years ago by Nicolas Rybkin

comment:1 Changed 9 years ago by andrew_b

  • Description modified (diff)

comment:2 Changed 9 years ago by mooffie

Why do I need this: I need to use 3 bytes to store some data related to file

With mc^2 you can write your own fields easily. You don't need to hijack existing fields. Visit the screenshots page to see this in action.

comment:3 Changed 8 years ago by Nicolas Rybkin

please kill this ticket, ticket #3650 solves the problem.

Last edited 8 years ago by andrew_b (previous) (diff)
Note: See TracTickets for help on using tickets.