Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filetostr()
Message
De
25/07/2006 13:09:26
 
 
À
24/07/2006 13:52:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
01139313
Message ID:
01139803
Vues:
11
>This is related to another thread and got a good suggestion by Dragan to use FILETOSTR() function.
>
>So basically I'm using this function to copy the contents of a file to a string. The thing is that this file is the customer list used by an application, so it's very critical that I abide by it's rules to open this file. In the documentation these are the pre-requisites to opening the file by an outside application.
>
>1) File Handles must be used
>2) Should be opened with
> a. Inheritance Flag Set - This says the file is private to the current session
> b. Sharing Mode - Sharing mode should be set to Deny None.
> c. Access - Access Mode should be set for Read/Write access.
>
>What does FILETOSTR() do when it comes to these rules?
>
>I could just take the chance and see if there's a problem which I don't see happening but the system using this file is very critical so I can't afford to take the chance.
>
>Thanks.

try using the low-level file functions. Look at the setting for the FOPEN() function. You can open the file in a read-only mode. This can be done by many users at the same time.
local fhandle, lcStr
lcStr = ""
fhandle = FOPEN("<myfile>",10)   && open read-only unbuffered
if fhandle > -1
   do while not feof( fHandle )
      lcStr = fgets( fHandle ) + chr(13)+chr(10)
   enddo
endif
fclose( fHandle )
Greg Reichert
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform