Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining file size
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01019302
Message ID:
01019318
Vues:
24
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform