11-29-2011
inodes are data about a file in a given filesystem. What is stored in an inode is system dependent, there is no standard.
POSIX compliant systems specifically update ctime (where ever it is kept) only with a change involving:
1. file creation
2. file permissions
3. acl changes
Otherwise ctime would have no meaning because it would be identical to atime. Every read access would update the file status time as well as the access time
Check out the utime() call on your system, or google for 'opengroup.org: utime'. utime() does update ctime.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i have used all forms of the unix find command.. and right now this is the only command i can think of that might have this option..:
if i use mtime i am looking at a time interval.. but if i wanted to find out intervals of access, change and modification according to when a file changed size... (4 Replies)
Discussion started by: moxxx68
4 Replies
2. Tips and Tutorials
Unix keeps 3 timestamps for each file: mtime, ctime, and atime. Most people seem to understand atime (access time), it is when the file was last read. There does seem to be some confusion between mtime and ctime though. ctime is the inode change time while mtime is the file modification time. ... (2 Replies)
Discussion started by: Perderabo
2 Replies
3. Shell Programming and Scripting
Hello,
I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^
Here is what I'm trying to achieve :
file1:
test filea 3495;
test fileb 4578;
test filec 7689;
test filey 9978;
test filez 12300;
file2:
test filea... (11 Replies)
Discussion started by: mecano
11 Replies
4. Shell Programming and Scripting
Can any one tell me how to find out ctime , mtime ,atime for a file/directory on unix.
Cheers,
Nilesh (5 Replies)
Discussion started by: nilesrex
5 Replies
5. UNIX for Advanced & Expert Users
hi, in trying to maintain your directories, one needs to do some housekeeping like removing old files. the tool "find" comes in handy. but how would you decide which option to use when it comes to, say, deleting files that are older than 5 days?
mtime - last modified
atime - last accessed... (4 Replies)
Discussion started by: pinoy43v3r
4 Replies
6. Shell Programming and Scripting
Hello guys,
I could use advise from more experienced guys about my Makefile. In short, the problem with my Makefile is that $< doesnt change
inside my rule.
Here is my Makefile:
# Makefile for CORE
CC = gcc.exe
AS = as.exe
AR = ar.exe
INCLUDE = \
-I../lib/tomcrypt/inc \... (1 Reply)
Discussion started by: Kodreanu
1 Replies
7. UNIX for Dummies Questions & Answers
I need to sort through a volume that contains video files by access time and delete files that have not been accessed over x days. I have to use the access time as video files are originals that do not get modified, just read
Testing commands on a local test folder...
$ date
Wed Sep 28... (10 Replies)
Discussion started by: canon273
10 Replies
8. AIX
Hello.
An update of TL from TL7 to TL8 is ending with errors :
Requisite Failures
------------------
SELECTED FILESETS: The following is a list of filesets that you asked to
install. They cannot be installed until all of their requisite filesets
are also installed. See subsequent... (4 Replies)
Discussion started by: stephnane
4 Replies
9. Solaris
It is widely documented that on zfs atime updates the access time on zfs.
Where is the access time updated on Solaris 11.2?
If I create file atimetest.txt under rpool/export/home:
# zfs list rpool/export/home
NAME USED AVAIL REFER MOUNTPOINT
rpool/export/home 13.3G ... (5 Replies)
Discussion started by: jabberwocky
5 Replies
UTIME(2) Linux Programmer's Manual UTIME(2)
NAME
utime, utimes - change file last access and modification times
SYNOPSIS
#include <sys/types.h>
#include <utime.h>
int utime(const char *filename, const struct utimbuf *times);
#include <sys/time.h>
int utimes(const char *filename, const struct timeval times[2]);
DESCRIPTION
The utime() system call changes the access and modification times of the inode specified by filename to the actime and modtime fields of
times respectively.
If times is NULL, then the access and modification times of the file are set to the current time.
Changing timestamps is permitted when: either the process has appropriate privileges, or the effective user ID equals the user ID of the
file, or times is NULL and the process has write permission for the file.
The utimbuf structure is:
struct utimbuf {
time_t actime; /* access time */
time_t modtime; /* modification time */
};
The utime() system call allows specification of timestamps with a resolution of 1 second.
The utimes() system call is similar, but the times argument refers to an array rather than a structure. The elements of this array are
timeval structures, which allow a precision of 1 microsecond for specifying timestamps. The timeval structure is:
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
times[0] specifies the new access time, and times[1] specifies the new modification time. If times is NULL, then analogously to utime(),
the access and modification times of the file are set to the current time.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EACCES Search permission is denied for one of the directories in the path prefix of path (see also path_resolution(7)).
EACCES times is NULL, the caller's effective user ID does not match the owner of the file, the caller does not have write access to the
file, and the caller is not privileged (Linux: does not have either the CAP_DAC_OVERRIDE or the CAP_FOWNER capability).
ENOENT filename does not exist.
EPERM times is not NULL, the caller's effective UID does not match the owner of the file, and the caller is not privileged (Linux: does
not have the CAP_FOWNER capability).
EROFS path resides on a read-only file system.
CONFORMING TO
utime(): SVr4, POSIX.1-2001. POSIX.1-2008 marks utime() as obsolete.
utimes(): 4.3BSD, POSIX.1-2001.
NOTES
Linux does not allow changing the timestamps on an immutable file, or setting the timestamps to something other than the current time on an
append-only file.
In libc4 and libc5, utimes() is just a wrapper for utime() and hence does not allow a subsecond resolution.
SEE ALSO
chattr(1), futimesat(2), stat(2), utimensat(2), futimes(3), futimens(3)
COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-08-06 UTIME(2)