Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening file with FOPEN
Message
From
06/07/2006 16:54:20
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01134285
Message ID:
01134288
Views:
15
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform