# filestat

Gets status information on a file or folder.

    filestat <filename> <size> [<mtime>] [<drive>]

## Remarks

Obtains information about the file or directory specified by <filename>.
<size> is set to the size of the file in bytes.
<mtime> is set to the time of last modification of file or folder.
<drive> is set to the drive number of the disk containing the file or folder.
The system variable "result" value of -1 indicates an error.

## Example

    filestat 'test.exe' size time drive

    if result = -1 then
    	messagebox 'file open error' 'filestat'
    else
    	sprintf2 str 'File size=%d Time modified=%s Drive=%s' size time drive
    	messagebox str 'filestat'
    endif

    filestat 'Macro' size time drive

    if result = -1 then
    	messagebox 'Directory open error' 'filestat'
    else
    	sprintf2 str 'Directory size=%d Time modified=%s Drive=%s' size time drive
    	messagebox str 'filestat'
    	; ex. Directory size=0 Time modified=2014-03-04 22:44:47 Drive=C
    endif

## See also

- foldersearch
- getfileattr