Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble setting read-only flag on Linux Server
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Trouble setting read-only flag on Linux Server
Miscellaneous
Thread ID:
00703494
Message ID:
00703494
Views:
50
Hello,

I seem to have trouble setting a read-only attribute flag on a file that resides on a Linux Server.

Here is the code:
Lparameters cFileName, cSetReadStatus

If not file(cFileName)
	=dialog("Warning","No Matching File Name Found for "+alltrim(cFileName)+".","File Not Found")
	Return
Endif

Declare SHORT SetFileAttributes IN KERNEL32 ;
	STRING @ lpFileName, ;
	INTEGER dwAttributes
Declare INTEGER GetFileAttributes IN WIN32API STRING @ lpFileName


#Define FILE_ATTRIBUTE_READONLY 1

lcFileName=fullpath(cFileName)
Do case
Case upper(cSetReadStatus)=="READ/WRITE"
	nSuccess=SetFileAttributes(lcFileName, 0) && Remove all attributes
Otherwise
	nSuccess=SetFileAttributes(lcFileName, BITOR(GetFileAttributes(lcFileName),FILE_ATTRIBUTE_READONLY)) && Make read-only
Endcase

RETURN
The weird thing is that nSuccess is returning .t., but the read-only flag is not checked. Any assistance or tips would be appreciated. I am assuming it may be a windows vs. Linux issue, but there must be some command that will work.

Thanks in advance,

Kevin
Kevin Emmrich
www.jkt9000.com
Next
Reply
Map
View

Click here to load this message in the networking platform