http://oss.sgi.com/bugzilla/show_bug.cgi?id=774
------- Additional Comments From cattelan@xxxxxxxxxxx 2008-01-22 13:57 CST
-------
Run this on xfs and ext3.
ext3:
bozer[3:55pm]#/tmp/test testfile
base time: mtime 1201038905 ctime 1201038905
should be new: mtime 1201038908 ctime 1201038908
should be same: mtime 1201038908 ctime 1201038908
xfs:
bozer[3:55pm]#/tmp/test testfile
base time: mtime 1201038928 ctime 1201038928
should be new: mtime 1201038931 ctime 1201038931
should be same: mtime 1201038934 ctime 1201038934
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <fcntl.h>
int
main(int argc, char *argv[]) {
int ret;
struct stat buf;
int fd;
fd = open(argv[1], O_CREAT|O_RDWR, S_IRWXU);
write(fd,"abcdefghijklmnopqrstuvwxyz",26);
ret = truncate(argv[1],5);
stat(argv[1], &buf);
printf("base time: mtime %d ctime %d\n",buf.st_mtime,buf.st_ctime);
sleep(3);
ret = truncate(argv[1],4);
stat(argv[1], &buf);
printf("should be new: mtime %d ctime %d\n",buf.st_mtime,buf.st_ctime);
sleep(3);
ret = truncate(argv[1],4);
stat(argv[1], &buf);
printf("should be same: mtime %d ctime %d\n",buf.st_mtime,buf.st_ctime);
}
--
Configure bugmail: http://oss.sgi.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
|