Re: [D5] set folder creation date
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Wed, 20 Apr 2005 11:52:23 -0500
Fodox wrote:
i have to set the creation date of a folder, this is my code:
The JCL already has functions that should be able to do what you need.
http://jcl.sf.net/
hDir:=OpenFile(pChar(stDir), struct, OF_READWRITE or OF_SHARE_EXCLUSIVE);
It's been nearly ten years. I think it's time to stop using OpenFile and move on to CreateFile, as the documentation recommends.
if hDir>0 then begin
If OpenFile fails, it returns HFile_Error. I have no idea what the numeric value of that constant is, but it doesn't matter. All you need to do is check whether hDir is equal to (not greater than or less than) that constant.
SetFileTime(hDir,@DirTime,@DirTime,@DirTime); FileClose(hDir); end;
it don't work: reading the struct's data i always see ERROR 5 (file access denied?). why that?
Maybe you can't get exclusive read-write access to the directory? That might be caused by some other program having that directory open as its current directory.
-- Rob .
- References:
- [D5] set folder creation date
- From: Fodox
- [D5] set folder creation date
- Prev by Date: Re: Programming with COM port
- Next by Date: Re: My GOD ... How to register .pas component in D2005? URGENT...
- Previous by thread: [D5] set folder creation date
- Next by thread: Re: [D5] set folder creation date
- Index(es):