从struct stat中获取file的 time of last access,并用char *ctime(time_t *t)转换成可读形式
以下是我写的一段程序,程序编译正常通过,当运行时返回:Segmentation fault
请问是怎么回事,谢谢了。
#include
by xuwlhhui - C/C++ - 2008-03-11 16:21:58 阅读(7469) 回复(10)
请问ls -l 的时间是什么时间,相当于atime,ctime,还是mtime??? 如果我想把目录下面的所有(ls -l)显示的时间距今超过90天的文件全部删除,find应该用哪个参数?
请问使用ctime类取得系统时间后,怎样将其时间部分置零。如: ctime T; T=T.GetCurrentTime(); 怎样将T的时分秒置零。另外如何将一个时间格式的字符串赋值给T?
find /tmp -ctime +2 我执行这条命令的时候,他的意思是找2天以前的资料,那么他找的顺序是什么样的?是从距离现在最远时间点开始寻找还是杂2天以前的所有文件中随机的开始寻找?
atime: access time mtime: modify time (timestamp) ctime: change time mtime 和ctime 的区别在于是更改文件内容,还是更改文件属性。前者是文件内容发生了变化,后者是文件的索引节点发生变化。 如,touch 文件abc.123,看atime, mtime, ctime #istat abc.123 Inode 1271 on device 10/4 File Protection: rw-r--r-- Owner: 0(root) Group: 0(system) Link count: 1 Length...
当前目录下有100多个文件,使用find . -ctime 1只列出了几个文件,但是find. -ctime 1|ls -l 却把那100多个都列了出来,Why?
[CODE] time_t t; time(&t); printf("now time is:%s",ctime(&t)); [/CODE] 我现在要写日志文件 时间和内容要写在一行 但是ctime 返回的字符串默认怎么加了换行?
我发现在程序有require "ctime.pl"; 但是在这个目录下没有这个文件,从网上down了一个,好象不对? [code] ;# ctime.pl is a simple Perl emulation for the well known ctime(3C) function. # # This library is no longer being maintained, and is included for backward # compatibility with Perl 4 programs which may require it. # # In particular, this should not be used as an example of modern Perl # programming ...