Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening file with FOPEN
Message
De
06/07/2006 16:54:20
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
06/07/2006 16:32:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01134285
Message ID:
01134288
Vues:
16
>Hi,
>
>I'm reading a file containing text and binary (extension .dat) information with FOPEN.
>
>This file is used by a software and in the manual it says that if the file is going to be opened by an outside program these are the requirements:
>
>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.
>
>I know about the file handle, don't know 'a' and 'b', for 'c' there's "buffered" and "unbuffered" I guess for my purpose it doesn't matter b/c I'm just reading from it.
>
>Does somebody know how to do 'a' and 'b'? or if foxpro is already setting this automatically?

The simplest way would be to just use FileToStr() and have the whole file in a string. FileToStr() can open files which are open by another app (which fOpen() won't do), and closes them immediately, so there's no colision.

You can then proceed by doing your operation on the string received (chopping it in any manner you like), or by copying into your private copy of the file, by StrtoFile() and then opening that copy with fOpen() and erasing it when you're done.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform