disk space ...

Prev Next

Function Names

disk space, disk space free

Description

Returns the total resp. free space of the specified drive. It also works for network drives.

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
Opt. 1
input
string drive or path name

Specify a disk drive (e.g. C:\) or a path name (/usr/local, or \\server_name\path_name\...)

Return value

TypeDescription
numeral Size information

Disk space / free disk space in bytes

Exceptions

Invalid path name or nonexisting drive

Examples

               path[] = select if( system info[operating system] == Windows, "C:\", "/home" );

               echo( str( disk space( path[] ), "#,000", local ) );
               echo( str( disk space free( path[] ), "#,000", local ) );

Output

510'666'993'664
58'277'801'984
Try it yourself: Open LIB_Function_disk_space.b4p in B4P_Examples.zip. Decompress before use.