Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Low Level File Blues
Message
From
16/08/2000 13:30:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00405598
Message ID:
00405633
Views:
19
Stephen,
That's first correction but not finished. fgets() would only get first line not whole content + fgets() and fread() are both buggy in VFP3-6 depending on version (supposedly they should work with files up to 2Gb in length).
Cetin

>Thanks! I have been staring at that for too loong and not seeing it!
>
>

>>The first parameter in Fwrite, Fputs, Fflush and Fclose has to be a file handle from Fopen. It's gnFileHandle in your case .
>>

>>>I am doing some fixing of Credit Card Postings in a pcc file. Here is how the file is opened:
>>>Store FOPEN('a:\NPC1.pcc') TO gnFileHandle && Open the file
>>>Store FSEEK(gnFileHandle, 0, 2) TO gnEnd && Move pointer to EOF
>>>Store FSEEK(gnFileHandle, 0) TO gnTop && Move pointer to BOF
>>>*-- gstring is the contents
>>>gcString = FGETS(gnFileHandle, gnEnd) && Store contents
>>>*-- what we started with
>>>g1=gcString
>>>
>>>I find my bits, switch them and then try to FWRITE() but it returns 0, and the changes are not stored.
>>>
>>>Here is my closing :
>>>w=Fwrite('a:\NPC1.pcc', gcString, gnEnd)
>>>
>>>fflush('a:\NPC1.pcc')
>>>fclose('a:\NPC1.pcc')
>>>
>>>W will always = 0?
>>>
>>>What am i missing?
>>>
>>>If I do :
>>>y=fputs('a:\NPC1.pcc', gcString, gnEnd)
>>>it give no result = 0
>>>
>>>TIA
>>>__Stephen
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform