I have been told by a professor that you can get a file's last modification time by using utime.h. However, the man page seem to cite that utime() only sets this value. How can I look up the last time a file was changed in C on a UNIX system?
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
- Equivalent of std::pair in C
You can use the stat system call to get the last access and modification times.
This returns the file's mtime, the "time of last data modification". Note that Unix also has a concept ctime, the "time of last status change" (see also ctime, atime, mtime).