Skip to content

IS_DIR_EMPTY ​

IS_DIR_EMPTY determines whether a specified directory is empty or not.

Syntax ​

leo-grammar
CC "AdoScript" IS_DIR_EMPTY	path:strValue

 # --> RESULT isempty:boolValue ecode:intValue .
CC "AdoScript" IS_DIR_EMPTY	path:strValue

 # --> RESULT isempty:boolValue ecode:intValue .

Parameters ​

  • path (strValue) - path to the directory which shall be tested

Returns ​

  • isempty (boolValue) - 1 if the directory is empty, 0 if it is not
  • ecode (intValue) - Contains the error code or 0 in case of success.

Details ​

Note that backslashes have to be masked (e.g. "c:\temp\gen"). Relative paths relate to the current working directory (CWD).

See Also: ​

Examples ​

asc
SET dir:"c:\\temp\\gen"
CC "AdoScript" IS_DIR_EMPTY path:(dir)
IF (ecode) {
    CC "AdoScript" ERRORBOX (dir + " cannot be accessed.")
} 
ELSIF (isempty) {
    CC "AdoScript" INFOBOX (dir + " is empty.")
} 
ELSE {
    CC "AdoScript" INFOBOX (dir + " is not empty.")
}
SET dir:"c:\\temp\\gen"
CC "AdoScript" IS_DIR_EMPTY path:(dir)
IF (ecode) {
    CC "AdoScript" ERRORBOX (dir + " cannot be accessed.")
} 
ELSIF (isempty) {
    CC "AdoScript" INFOBOX (dir + " is empty.")
} 
ELSE {
    CC "AdoScript" INFOBOX (dir + " is not empty.")
}

Versions and Changes ​

Available since ADOxx 1.3