Re: [D5] set folder creation date
- From: "Martin Harvey" <martin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Apr 2005 19:11:59 GMT
"Fodox" <fodox.it@xxxxxxxxx> wrote in message
news:731b4726.0504192349.a990e8a@xxxxxxxxxxxxxxxxxxxxx
> it don't work: reading the struct's data i always see ERROR 5 (file
> access denied?). why that?
> how can i do?
I've just been looking through some of my own code, which has some fairly
illuminating comments in it ... stuff I must have figured out a couple of
years back. It says:
//Code below isn't perfect - there is a small window
//for intervening code to mess up the result.
<a bunch of code>
//This still feels a bit dodgy, but problems with getting
//directory attributes - only NT & XP support the create file function for
//directories. Could do a FindFirst op, but prefer not to at the moment.
<another bunch of code>
So what's going on? Well, I'm not going to give you the long answer, because
the search function in MSDN appears to be FUBARRED, but I will say this:
You have Win32 API calls CreateDirectory, CreateFile, SetFileTime etc.
I seem to recall that the various permissions and flags you need to do the
required date handling on the directory varies from platform to platform. I
suspect XP and NT support things that earlier versions don't.
If I were you, I'd resort to using the Win32 API, and copious use of the
"GetLastError" function call :-)
MH.
.
- References:
- [D5] set folder creation date
- From: Fodox
- [D5] set folder creation date
- Prev by Date: Re: My GOD ... How to register .pas component in D2005? URGENT...
- Next by Date: Re: WANTED! A copy of Delphi in a hurry.
- Previous by thread: Re: [D5] set folder creation date
- Next by thread: Moving to Delphi 2005
- Index(es):
Relevant Pages
|
|