Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining file size
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019302
Message ID:
01019318
Views:
23
To add ione more function between this rain of functions :o)))
Function FileSizeInKB(cFilename)  && Tore's Name of function
   Local lhFileHandler, lnSize
   lhFileHandler = FOPEN(cFilename,0)
   IF cFilename < 0
      **** Error Message File can't be open
      RETURN 0
   ENDIF
   lnSize = FSEEK(lhFileHandler,0,2)  && Seek the end of file
   FCLOSE(lhFileHandler)

RETURN lnSize/1024


****** OR (not for BIG files)

Function FileSizeInKB(cFilename)  && Tore's Name of function
   Local lcStr
   lcStr = FILETOSTR(cFilename)
RETURN LEN(lcStr)/1024
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform