Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with FEOF() & dir
Message
De
22/12/2000 03:05:19
James Beerbower
James Beerbower Enterprises
Hochheim Am Main, Allemagne
 
 
À
21/12/2000 07:27:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00455784
Message ID:
00456200
Vues:
36
>I have a relatively large text file (3-4 GB) which VFP, when I display information about it with DIR, reports as being of negative 2 GB (yeah -2.3 GB). This wouldn't be in itself tragic but feof() and fseek confirm that the file is empty. fget() still works. I did a work around using
>lcLine =fget(lnHandle)
>do while !empty(lcLine)
>...
>etc but my workaround doesn't work - probably there is an empty line (just a carriage return) in the text file. Anyone have any ideas?
>
>Thanks in advance!
>
>To Workaround your Workaround... (Yeurggh) you could try getting a few lines at a time and test them all for empty.
>lcLine1 = fGets(lnHandle)
>lcLine2 = fGets(lnHandle)
>lcLine3 = fGets(lnHandle)
>do while Not Empty(lcLine1 + lcline2 + lcline3)
>
>I haven't tested this so I don't know what the subsequent fGets will do when you really are at feof()
>
>Will

Thanks for the suggestion. When you fgets() at feof() you get an empty string which is ok. So I'm replacing the fgets in my program with

func myfgets
lpara tnHandle
local lcReturn
for m.i = 1 to 1000
lcReturn = fgets(tnHandle,8000) && long lines
if !empty(lcReturn)
exit
endif
endfor
return lcReturn
endf

The drag is the process takes a night to run and is sitting on a computer in DC so everything is slow as molasses. I'm also writing tools to try to figure out why the workaround dropped...oh well...
James Beerbower
James Beerbower Enterprises
Frankfurt, Deutschland
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform