Hogyan lehet megváltoztatni egy fájl 'change' időbélyegzőjét?
Access és Modify megváltoztatására ott a
touch -a -m -t 201106301555 file.ext
Change-re viszont nem találtam touch kapcsolót. Azt mivel lehet megváltoztatni?
- 2755 megtekintés
Hozzászólások
Ha megváltoztatod a rendszeridőt és touch, vagy közvetlenül a fájlrendszer piszkálásával.
Vagy esetleg átheggeszted a kernelt errefele.
- A hozzászóláshoz be kell jelentkezni
Hát, ez bonyolultabb kérdés.
Modify time megváltoztatása oké, az a fájlhoz tartozó attributum.
A "create time" valójában nem fájlhoz tartozó idő, hanem az inode létrehozásának/módosításának ideje.
Lásd:
ls -lc
chmod 444 testfile
ls -lc
És aktuális időre változott a "ctime", mivel módosult az inode.
- A hozzászóláshoz be kell jelentkezni
man 2 stat
...
struct timespec st_atim; /* time of last access */
struct timespec st_mtim; /* time of last modification */
struct timespec st_ctim; /* time of last status change */
...
The field st_atime is changed by file accesses, for example, by
execve(2), mknod(2), pipe(2), utime(2), and read(2) (of more than zero
bytes). Other routines, like mmap(2), may or may not update st_atime.
The field st_mtime is changed by file modifications, for example, by
mknod(2), truncate(2), utime(2), and write(2) (of more than zero
bytes). Moreover, st_mtime of a directory is changed by the creation
or deletion of files in that directory. The st_mtime field is not
changed for changes in owner, group, hard link count, or mode.
The field st_ctime is changed by writing or by setting inode informa‐
tion (i.e., owner, group, link count, mode, etc.).
- A hozzászóláshoz be kell jelentkezni