Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-04

changing datetime of directories under DOS/Win

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

anonymous anonymous

I'd like to ask if there is any way to change the timestamp of directories under DOS/Win.

I'm writing a small command-line utility for file/dir manipulations. The only unit I've used is "sysutils". It has "fileage" and "filesetdate". Under DOS, these functions work well for files, but not for directories. However, they produce no problem under Linux.

I guess this problem may be due to different OS designs, but I'd like to have the functions work under DOS/Win.

_________________________________________________________________ Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

Michael Van Canneyt
to anonymous anonymous
anonymous anonymous wrote 7 lines
I'd like to ask if there is any way to change the timestamp of directories under DOS/Win. I'm writing a small command-line utility for file/dir manipulations. The only unit I've used is "sysutils". It has "fileage" and "filesetdate". Under DOS, these functions work well for files, but not for directories. However, they produce no problem under Linux. I guess this problem may be due to different OS designs, but I'd like to have the functions work under DOS/Win.

I've never seen a call to set the time stamp of a directory under DOS/Windows, it may simply not be supported under these OSes.

Michael.

anonymous anonymous
Show quoted text 13 lines
On Tue, 22 Apr 2008, anonymous anonymous wrote: > I'd like to ask if there is any way to change the timestamp of directories under DOS/Win. > > I'm writing a small command-line utility for file/dir manipulations. The only unit I've used is "sysutils". It has "fileage" and "filesetdate". Under DOS, these functions work well for files, but not for directories. However, they > produce no problem under Linux. > > I guess this problem may be due to different OS designs, but I'd like to have the functions work under DOS/Win. I've never seen a call to set the time stamp of a directory under DOS/Windows, it may simply not be supported under these OSes. Michael.

Thank you for your information.

The need for such a function arises in making "exact" copies of directory trees. Windows Explorer can copy directory trees, but it has a number of problems such as :
1. directory timestamps are changed to the creation date/time;
2. all the target files have the "archive" attribute set (only Win98 preserves file attributes);
3. in some occasions the timestamps of the target files are changed a little bit so that Win Exp does not show the difference (in seconds) but some directory comparison softwares can detect the change.

In view of these problems, I'm thinking of rewriting the "xcopy" command. The problems 2 & 3 are solved, but I can't get a way to solve problem 1.

_________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us