Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining size of (output) text file?
Message
From
30/12/1996 07:46:30
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00016085
Message ID:
00016163
Views:
30
>I'm looking for the best way to:
>1. Stream text to an output file, and...
>2. Use as much of VFP's ease-of-use as possible to do so (such as the "?" and the "\" operators), and...
>3. (the problem) I need as much awareness as possible as to the size of the output file while it is growing. I need to know the EOF position (size of file in bytes) as the file is incrementally growing.
>
>What I have found:
>
>- Using SET PRINT TO filename. For some reason, the line terminators are not CRLFs, but only LFs. You can use the PROW() function to get the current line number. No way to get the actual byte count that I know of.
>
>- Using SET ALTERNATE TO filename. The line terminators are CRLFs.. You cannot use the PROW() function to get the current line number. No way to get the actual byte count that I know of.
>
>- I have not been able to get access to the file handle that VFP uses for either of SET Alternate or Set Print.
>
>- Likely the *only* solution, but still not certain: Use the _Text system memory variable, which connects low-level file I/O capabilities with VFP's textmerge facilities (but not the "?" operator). VFP doesn't actually say if you can mix LL file i/o (using Fread, FWrite, FSeek, etc) with actual textmerge operations such as "\" and "\\". Anybody know?
>Thanks!

Mark,
Since you are using "?" and/or "\" operators to output your text strings, one possibility would be to determine the length of the output text string just before you write it out each time and add that length to a variable yoyu declare. This should give you a pretty good idea at any time what the total number of bytes that have been written out.

HTH,
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform