>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement