Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining whether you can open a file
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00806880
Message ID:
00806888
Views:
7
Neil,
Open the file with a low level open.
Lparameters lcFileName
Local llReturn, lnFID
	llReturn = .F.
	If File(lcFileName)
		lnFID = Fopen(lcFileName, 11)
		If lnFID = -1
			llReturn = .T.
		Else
			=Fclose(lnFID)
		EndIf
	EndIf
Return llReturn
HTH
Caroline

>I have a very perculiar problem to sort out.
>
>The problem is I have a number of users in a system which is determined within a program which I cannot hook into. But each user has a directory called profile and when they are in the system there is a file in that directory which cannot be opened. A typical example would be:
>
>There is a user Peter which has a permanent number called user 26.
>
>Therefore in the program loadpoint it would like:
>
>\\PROFILE\USER26\Insystem.DBF
>
>If you try and open this file when the user is NOT in the system everything is fine. If you try and open the file if the user is in the system then you get a message 'File access is denied U:\Profile\User26\Insystem.dbf'
>
>What I would like to do is to scan each of the user directories to see whether the users are in the system. Is there anyway I can check to see if you can open this file for example if you can't I get a MessageBox User is in system or User is not in system.
>
>Many Thanks
Caroline
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform