suve

awful: function: file-size

Available since rev.39 (v.0.5.3).

Declaration

int :file-size ( string $FILEPATH )

Summary

Returns the size of file existing under FILEPATH, in bytes. If the file does not exist, or an error has occured, returns -1.

Example

# :file-size example
:set &path s''
:readln &path
 
:set &size :file-size $path
!if :ge $size i0
    :writeln $path s' is ' (:file-size $path) s' bytes in size.'
!else
    :writeln s'Oh noes! It appears that ' $path s' does not exist.'
!fi

wikipage modified on 2014/0609/2253