The code is as follow:

    Err resultSet;
    uint32_t fileAttr;
    VFSFileOpen(gSelectedVolRefNum, FilePath, vfsModeReadWrite,
&fileDetails);
    VFSFileGetAttributes(fileDetails, &fileAttr);
    resultSet = VFSFileSetAttributes(fileDetails, isReadonly ? fileAttr |
vfsFileAttrReadOnly : fileAttr & ~vfsFileAttrReadOnly);
    VFSFileClose(fileDetails);

It works well if the file is a regular file ,but return error 0x0502 if the
file is directory.
Please help!

Far ocean

"Miro Pomsar" <[EMAIL PROTECTED]> ???? news:[EMAIL PROTECTED]

One more thing you probalby already figured out is, that you have to
open the file in readwrite mode
to set attributes or dates.

Regards,
Miro Pomsar



>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of
>news.PalmOS.com
>Sent: Wednesday, September 21, 2005 08:45
>To: Palm Developer Forum
>Subject: Fail to change the readonly attribute of directory
>
>¿Õ°×Now i want to change the readonly attributes of a file. If
>it is a regular file, the function VFSFileSetAttributes works
>well. But if it is a directory, it returns the error 0x0502.
>Is there any method to change the readonly attribute of
>directory? please help!
>
>Far Ocean
>
>
>
>--
>For information on using the PalmSource Developer Forums, or
>to unsubscribe, please see http://www.palmos.com/dev/support/forums/
>




-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to