Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

utime(3c) [bsd man page]

UTIME(3C)																 UTIME(3C)

NAME
utime - set file times SYNOPSIS
#include <sys/types.h> utime(file, timep) char *file; time_t timep[2]; DESCRIPTION
This interface is obsoleted by utimes(2). The utime call uses the `accessed' and `updated' times in that order from the timep vector to set the corresponding recorded times for file. The caller must be the owner of the file or the super-user. The `inode-changed' time of the file is set to the current time. SEE ALSO
utimes(2), stat(2) 4th Berkeley Distribution May 9, 1985 UTIME(3C)

Check Out this Related Man Page

UTIME(2)						     Linux Programmer's Manual							  UTIME(2)

NAME
utime, utimes - change access and/or modification times of an inode SYNOPSIS
#include <sys/types.h> #include <utime.h> int utime(const char *filename, struct utimbuf *buf); #include <sys/time.h> int utimes(char *filename, struct timeval *tvp); DESCRIPTION
utime changes the access and modification times of the inode specified by filename to the actime and modtime fields of buf respectively. If buf is NULL, then the access and modification times of the file are set to the current time. The utimbuf structure is: struct utimbuf { time_t actime; /* access time */ time_t modtime; /* modification time */ }; In the Linux DLL 4.4.1 libraries, utimes is just a wrapper for utime: tvp[0].tv_sec is actime, and tvp[1].tv_sec is modtime. The timeval structure is: struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microseconds */ }; RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
Other errors may occur. EACCES Permission to write the file is denied. ENOENT filename does not exist. CONFORMING TO
utime: SVr4, SVID, POSIX. SVr4 documents additional error conditions EFAULT, EINTR, ELOOP, EMULTIHOP, ENAMETOOLONG, ENOLINK, ENOTDIR, ENO- LINK, ENOTDIR, EPERM, EROFS. utimes: BSD 4.3 SEE ALSO
stat(2) Linux 1995-06-10 UTIME(2)
Man Page

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Process Information

Hi, If we have a process p1 running and then p2 attempts to shutdown p1. Is there a means for p1 to know who has requested him to shutdown Thanks and regards, Reji (1 Reply)
Discussion started by: rejise
1 Replies

2. Shell Programming and Scripting

Utime Command

Hello ! Do you have any example of the utime command ? I'm trying to change the time of last change of a file to a defined time. Thanks. (3 Replies)
Discussion started by: margue
3 Replies

3. Programming

equivalent to utime

Hi, Is there any system call which changes the time of symbolic link apart from utime? or if tere is no system call any other option of how to do it? Thanks (4 Replies)
Discussion started by: naan
4 Replies

4. Shell Programming and Scripting

Cannot utime: Operation not permitted

Hi - I have a script (.ksh) which has been transferred from one Linux box to another. Basically it untars a file a deploys the code to the relevent directories. It is failing with ' Cannot utime: Operation not permitted' When I run the command by hand it *is* doing the untar to the directories... (1 Reply)
Discussion started by: ajcannon
1 Replies

5. UNIX for Advanced & Expert Users

problem with tar

First of all I have already asked about this in the scripts/perl forum but the advice I got did not do the trick. A script I have to use unzips some xxx.tar.gz files and then tries to tar -xvf them. on the tar -xvf I get the following:- tar: code/sql: Cannot utime: Operation not permitted... (14 Replies)
Discussion started by: ajcannon
14 Replies

6. Programming

utime returning -1 BAD File DEscriptor

Hi All, First of all thanks for reading this post. In my application, I am trying to create a new message queue . I am attaching the code below. mqd_t mqopen2(const char * pName, unsigned long Flags, long maxMsg, long msgSz) {... (15 Replies)
Discussion started by: parusasi
15 Replies

7. UNIX for Beginners Questions & Answers

Unsure why access time on a directory change isn't changing

Hello... And thanks in advance for any help anyone can offer me I was trying to work out the differences between displaying modify, access, and change times with the 'ls' command. Everything seems in order when I look at files, but the access time on a directory doesn't seem to change when I... (4 Replies)
Discussion started by: bodisha
4 Replies