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:07:24
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
How to get size of large file
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01545180
Message ID:
01545180
Views:
105
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
Andrus
Next
Reply
Map
View

Click here to load this message in the networking platform