Hi,

I am adding some useful options to touch command:

-a, --access-time    Change only the access time
-c, --no-create        Do not create new files
-m, --mod-time       Change only the modification time

Adding -c option was pretty easy. Now, i am having problem in adding -a and
-m options.

The struct stat is defined as following:

struct stat {
    fs_handle_t fs_handle;
    service_id_t service_id;
    fs_index_t index;
    unsigned int lnkcnt;
    bool is_file;
    bool is_directory;
    aoff64_t size;
    service_id_t service;
};

There is no equivalent to st_atime and st_ctime here, and hence the
structure returned by the call to stat() or fstat() doesn't help much. So,
how should i get the last access and modification times of a file ? I saw
that there is a 'struct posix_stat' in uspace/lib/posix/sys/stat.h, and
corresponding posix_stat() and posix_fstat() functions
in uspace/lib/posix/sys/stat.c. Is this 'struct posix_stat' meant to be
used in some way ?


Thanks,
Vivek Prakash
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to