Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get size of large file
Message
From
03/06/2012 11:26:06
 
 
To
03/06/2012 11:07:24
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01545180
Message ID:
01545181
Views:
117
This message has been marked as the solution to the initial question of the thread.
>Code below is used to get size of file.
>For 6 GB file, invalid seek offset error occurs in line shown in comment.
>How to get size of large file ?
>
>
* Returns size of file in bytes.
>FUNCTION FILELEN( prmFileName )
>
>local readfile, filelen
>* todo: for large file next line caues invalid seek offset error
>readfile = FOPEN( m.prmFileName, 10)	&& 10=r/o unbuffered
>if m.readfile=-1
>  return 0
>  endif
>filelen  = FSEEK( m.readfile, 0, 2)
>fclose( m.readfile )
>return m.filelen
use adir()
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform