Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modify permission of a file.
Message
 
 
To
12/09/2006 13:47:16
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00870530
Message ID:
01153110
Views:
26
>>>>>Hi all !
>>>>>
>>>>>Exist some command in the vfp that modify the permission of a file without using FileSystemObject ?
>>>>>
>>>>Check How to change file attributes programmatically FAQ #15763
>>>
>>>Hello Sergey,
>>>
>>>I have used Windows Scripting Host, using FileSystemObject (oFSO) which works great until now. I got an error message "OLE error code 0x800a0035: Unknown COM status code" that occured after oFile = oFSO.GetFile(lcFile). What do you think is the problem?
>>
>>
>>The file doesn't exist.
>
>Ah, thank you very much! It does make sense, however, I find it ironic because the code is as follows:
>
>
IF file(lcFile)
>   oFSO = CREATEOBJECT("Scripting.FileSystemObject")
>   * Get attributes
>   oFile = oFSO.GetFile(lcFile)
>   * Turn off the read-only flag
>   IF BITAND(oFile.Attributes, 1) = 1 THEN
>     oFile.Attributes = BITXOR(oFile.Attributes, 1)
>   ENDIF
>   RELEASE ALL LIKE oF*
>ENDIF
>If the file doesn't exist, this wouldn't fire off...

It may if file exists on VFP path but not where FileSystemObject expects it. Change code to
IF oFSO.FileExists(lcFile)
...
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform