>What is the best way to change a file attribute?
>I want to be able to make a file readable (if not already)
>I would rather not have to use the DOS attrib function, so I don't have to
>mess with the DOS window and pif's and so on.
>
>Here is what I tried:
>Declare Integer CreateFile in WIN32API STRING, INTEGER, INTEGER, INTEGER, INTEGER, INTEGER, INTEGER
>Declare Integer CloseHandle in WIN32API INTEGER
>fhHandle = CreateFile('FileName',0,0,0,3,32,0)
>=CloseHandle(fhHandle)
>
>where
>3 = OPEN_EXISTING
>32 = FILE_ATTRIBUTE_ARCHIVE
>I believe :-)
>
>I thought this would change the attrib, but when I did an ADIR() I see that
>the file is still read-only.
>
>Any wisdom would be greatly appreciated.
You have a FAQ on that here which explain the write and read for attributes. See the Knowledge Base FAQ section under WIN32API category.