xHarbour Reference Documentation > Function Reference |
Returns the size of a file.
FileSize( [<cFileName>], [<nAttributes>] ) --> nFileSize
Values for file attributes
Value | Attribute |
---|---|
0 | Normal |
1 | Read only |
2 | Hidden |
4 | System |
8 | Volume |
16 | Directory |
32 | Archived |
The function returns the size of the specified file in bytes as a numeric value, or -1 in case of an error.
See also: | FileAttr(), FileDate(), FileSeek(), FileTime() |
Category: | CT:DiskUtil , File functions , Low level file functions |
Source: | ct\files.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example lists file name and size of all PRG files // in the current directory. PROCEDURE Main LOCAL cFileName cFileName := FileSeek( "*.prg" ) DO WHILE .NOT. Empty( cFileName ) ? cFileName, FileSize() cFileName := FileSeek() ENDDO RETURN
http://www.xHarbour.com