stroke does not set ctime even when invoked by root user, no error message or error code (return status is 0)
The following line is the shell command line (create a file, show the times with stat, invoke stroke and then show the times with stat again)
and the next lines are the ouput of the command line
# date; touch ReportExport.xml ; stat ReportExport.xml ; src/stroke-0.1.2/src/stroke -v -ctime -s 200712241234.56:mac ReportExport.xml; echo $?; stat
ReportExport.xml
Tue Mar 16 00:30:33 CET 2010
File: `ReportExport.xml'
Size: 2134 Blocks: 8 IO Block: 4096 regular file
Device: 302h/770d Inode: 2934594 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ ah) Gid: ( 1000/ ah)
Access: 2010-03-16 00:30:33.000000000 +0100
Modify: 2010-03-16 00:30:33.000000000 +0100
Change: 2010-03-16 00:30:33.000000000 +0100
stroke: verbose: Retrieving current time
stroke: verbose: Scanning file "ReportExport.xml"
stroke: verbose: Evaluating time stamp expression `200712241234.56'
stroke: verbose: Assignment `mY=2007' made
stroke: verbose: Assignment `mM=12' made
stroke: verbose: Assignment `mD=24' made
stroke: verbose: Assignment `mh=12' made
stroke: verbose: Assignment `mm=34' made
stroke: verbose: Assignment `ms=56' made
stroke: verbose: Assignment `aY=2007' made
stroke: verbose: Assignment `aM=12' made
stroke: verbose: Assignment `aD=24' made
stroke: verbose: Assignment `ah=12' made
stroke: verbose: Assignment `am=34' made
stroke: verbose: Assignment `as=56' made
stroke: verbose: Assignment `cY=2007' made
stroke: verbose: Assignment `cM=12' made
stroke: verbose: Assignment `cD=24' made
stroke: verbose: Assignment `ch=12' made
stroke: verbose: Assignment `cm=34' made
stroke: verbose: Assignment `cs=56' made
stroke: verbose: Applying date and time alterations: "ReportExport.xml"
stroke: verbose: Attempting to modify change time
0
File: `ReportExport.xml'
Size: 2134 Blocks: 8 IO Block: 4096 regular file
Device: 302h/770d Inode: 2934594 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ ah) Gid: ( 1000/ ah)
Access: 2007-12-24 12:34:56.000000000 +0100
Modify: 2007-12-24 12:34:56.000000000 +0100
Change: 2010-03-16 00:30:33.000000000 +0100
System:
Linux 2.6.24-27-386 #1 Mon Feb 22 18:19:33 UTC 2010 i686 GNU/Linux
filesystem is ext3
It does not matter if the file (ReportExport.xml) exists before or not.
Would be nice to have the mod_ctime feature working especially for proper backup-restore scenarios.
Thanks
A. Haunschmidt
(haunand a t gmail.com)
Hello Mr. Haunschmidt,
thank you for the message.
I have tried your command on the following test system (as root, of course):
Linux 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010 i686 GNU/Linux, with ext4 filesystem
The output indicates that the change time modification was, contrary to your observation, indeed successful:
# date; touch ReportExport.xml ; stat ReportExport.xml ; src/stroke -v -ctime -s 200712241234.56:mac ReportExport.xml; echo $?; stat ReportExport.xml
Tue Mar 16 20:08:33 CET 2010
File: `ReportExport.xml'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 811h/2065d Inode: 787026 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ wave) Gid: ( 1000/ wave)
Access: 2010-03-16 20:08:33.360484737 +0100
Modify: 2010-03-16 20:08:33.360484737 +0100
Change: 2010-03-16 20:08:33.360484737 +0100
stroke: verbose: Retrieving current time
stroke: verbose: Scanning file "ReportExport.xml"
stroke: verbose: Evaluating time stamp expression `200712241234.56'
stroke: verbose: Assignment `mY=2007' made
stroke: verbose: Assignment `mM=12' made
stroke: verbose: Assignment `mD=24' made
stroke: verbose: Assignment `mh=12' made
stroke: verbose: Assignment `mm=34' made
stroke: verbose: Assignment `ms=56' made
stroke: verbose: Assignment `aY=2007' made
stroke: verbose: Assignment `aM=12' made
stroke: verbose: Assignment `aD=24' made
stroke: verbose: Assignment `ah=12' made
stroke: verbose: Assignment `am=34' made
stroke: verbose: Assignment `as=56' made
stroke: verbose: Assignment `cY=2007' made
stroke: verbose: Assignment `cM=12' made
stroke: verbose: Assignment `cD=24' made
stroke: verbose: Assignment `ch=12' made
stroke: verbose: Assignment `cm=34' made
stroke: verbose: Assignment `cs=56' made
stroke: verbose: Applying date and time alterations: "ReportExport.xml"
stroke: verbose: Attempting to modify change time
0
File: `ReportExport.xml'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 811h/2065d Inode: 787026 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ wave) Gid: ( 1000/ wave)
Access: 2007-12-24 12:34:56.000000000 +0100
Modify: 2007-12-24 12:34:56.000000000 +0100
Change: 2007-12-24 12:34:56.000000000 +0100
As you can see, the change time did get set to the desired value.
I will be trying to find reasons why it might have failed on your system. I might also be contacting you should I required additional information regarding your system and platform. Thanks again for reporting.
Sören Wellhöfer