Goto main content

size

Use to size a file

SIZE

NAME

size - Used to size a file

SYNOPSIS

size([error:variable,resursive:false|true], "filename");

DESCRIPTION

This function is used to size a file or a directory recursively. By default, "resursive" is true.

Return size in bytes.

PARAMETERS

Here is the list of parameters:

error
If an error occured while trying to size te file, the errcode and errmsg will be put in this associative array. If no error occurs, errcode will be zero.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{ a=size(recursive:false,"/"); a;}}. return res=45130.
res={_{ a=size(recursive:false,"/time"); a;}}. return res=23.
res={_{ a=size("/time"); a;}}. return res=23.
res={_{ a=size("/"); a;}}. return res=217528517.
res={_{ a=size("/qwdqwqw"); a;}}. return .*stat file.*
res={_{ a=size("/qwdqwqw",error:x); x.errcode;}}. return res=6.
res={_{ a=size("/",error:x); x.errcode;}}. return res=0.

SEE ALSO

{{ include("includes/files.sn") }}

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.