Do you also set the directory flag when setting the attributes?
I mean to set attr on file/directory you should do:

err = VFSFileGetAttributes(fref, attr) ;
if( err!=0 )
{
        err = VFSFileSetAttributes(fref, attr | vfsFileAttrReadOnly) ;
}

This way any previous attribute is preserved (hidden, system, archive).

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