>>>When a file is copied from a cd-rom to harddrive, that file is read-only. Is there any simple way to change the attribute using foxpro(vfp 3.0) commands ?
>>
>>I found the answer to this in the knowledge base here in U.T. - it came in quite handy. I have my code at work rather than here at home, tho - let me know if you cannot find it in the U.T.K.B. and I'll dredge out a code snippet from my own spagetti code at work.
>
>Try:
>
>
>
>DECLARE INTEGER SetFileAttribute IN WIN32API STRING cFileName, INTEGER nFileAttributeMask
>
>cFileName = cMyFullPathWithNoWildCards
>nMyFileMask = nAttributeMaskExpression
>
>IF (SetFileAttribute(cFileName, nMyFileMask) = 1)
> * it succeeded
>ELSE
> * it didn't
>ENDIF
>
>
>The full set of attribute masks is found in WINBASE.H; the most useful values are:
>
> R = Read-only 1
> H = Hidden 2
> S = System 4
> A = Archive 32
>
>Turn on an attribute by adding its value; for example, to make a file Hidden, Read-Only and System, use 1 + 2 + 4 for the attribute mask value; to set Normal, use 0.
>
>hth,
>
>Ed
It's SetFileAttributes, not SetFileAttribute