Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A File size function?
Message
De
16/07/1997 13:28:35
 
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00040249
Message ID:
00040263
Vues:
32
>>I'm stuck here re-coding some old foxpro stuff. It's been a while since I've written anything other then VFP programs. I'm about to go crazy :-P. Ok, can someone point me in the direction of a function that will return the size of a file? I could redirect the output of the foxpro dir command and parse it into an array or something, but I would really prefer to avoid ugly functions like that.
>
>ADIR(ArrayName [, cFileSkeleton [, cAttribute]])
>
>cAttribute:
>Column Array contents Data type
>1 File names Character
>2 File sizes Numeric
>3 Dates last modified Date
>4 Times last modified Character
>5 File attributes Character
>
>ADIR(myarray, '*.BMP')
>
>After you capture this info send it to a table that matches the array config.

Gilberto,

the following function works in vfp30
you can try it in foxpro windows 2.6

FUNCTION FileSize(tcFileName)
*-- Returns the size of a file. SET COMPATIBLE must be ON for
*-- FSIZE() to return the size of a file. Otherwise, it returns
*-- the size of a field.
LOCAL lcSetCompatible, lnFileSize

lcSetCompatible = SET('COMPATIBLE')
SET COMPATIBLE ON
lnFileSize = FSIZE(tcFileName)
SET COMPATIBLE &lcSetCompatible
Return lnFileSize
ENDFUNC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform