fileDir

 

 

Overview

The fileDir function returns a String containing the names of all files and sub-directories contained within the specified filePathname.

Note: The fileDir function will return "" if the specified file or directory does NOT exist.

Usage

The fileDir function is used to a list of the file names and sub-directory names contained within the specified directory or file name. For instance the following Lisp code shows how to generate the name of the current directory path.

(setq listing (fileDir _path)) ;; Return a listing for the current directory
(writeln listing) ;; Display the directory listing on the console
Tutorial_OnlineDocs<DIR>

The fileDir function can be used to a provide details for the specified directory or file name. For instance the following Lisp code shows how to generate the details for the current directory path.

(setq listing (fileDir _path true)) ;; Return a listing for the current directory and its details
(writeln listing) ;; Display the directory listing on the console
Tutorial_OnlineDocs<DIR>;CreationTime[2014,9,28,3,54,17,256];LastAccessTime[2014,10,22,4,41,37,923];LastWriteTime[2014,10,22,4,41,37,923];FileSize[0]

The fileDir function can be used to a provide a listing for a specified name including wild cards.

(setq listing (fileDir (append _path "/*.*"))) ;; Return a listing for the current directory
(writeln listing) ;; Display the directory listing on the console
.<DIR>
..<DIR>
ais.asl
ais.log
ais.rsl
Binary<DIR>
CoreContent<DIR>
Foundry<DIR>
myarchive.odb
mysqldata<DIR>
mysqlmsgs<DIR>
OldMySQLDocs<DIR>
OldWordDocs<DIR>
OldXMLDocs<DIR>
README.txt
References<DIR>
Source<DIR>
Templates<DIR>
workspace.db
wwwroot<DIR>

The fileDir function can be used to a provide a listing for a specified name including wild cards as follows.

(setq listing (fileDir (append _path "/*.*sl"))) ;; Return a listing for the current directory
(writeln listing) ;; Display the directory listing on the console
ais.asl
ais.rsl

 

Syntax


Expression:

(fileReadAll filePathName) ;; Return a listing for the current directory

(fileReadAll filePathName showDetailsSW) ;; Return a listing for the current directory


Arguments Name Type Description
Argument:filePathNameString Text The path and file name whose contents are to be listed
Argument:showDetailsSWBoolean If true, show details with each listing entry

Returns: Returns a String with the listing for the specified file or directory


 

Examples

Here are a number of links to Lambda coding examples which contain this instruction in various use cases.

 

Argument Types

Here are the links to the data types of the function arguments.

String Boolean

Here are also a number of links to functions having arguments with any of these data types.

*= abortTransaction addMethod appendWriteln
append badd balance bcompareEQ
bcompareGE bcompareGT bcompareLE bcompareLT
bcompareNE bdiv beginTransaction binaryInsert
binaryNand binaryNor binaryNot binaryNxor
binarySearch bitwiseAnd bitwiseNand bitwiseNor
bitwiseNot bitwiseNxor bitwiseOr bitwiseShiftLeft
bitwiseShiftRight bitwiseXor bmod bmul
boolean ccompareEQ ccompareGE ccompareGT
ccompareLE ccompareLT ccompareNE character
checkPointTransaction clean clear closeLog
code commitTransaction compareEQ compareGE
compareGT compareLE compareLT compareNE
compare comparison compile compress
cons count date day
days360 debugBrowsableProcs debugDetective debugEval
debug dimension disassemble display
downcase encode evalInSyncLocalContext eval
exportCsv exportSbf exportTab fdisplay
fileClose fileCopy fileDir fileDisplay
fileEraseDir fileErase fileExists fileMakeDir
fileOpen fileReadAll fileReadRecord fileRead
fileSizeOf fileWriteAll fileWrite filewriteln
findBlock find gc hashString
hour icompareEQ icompareGE icompareGT
icompareLE icompareLT icompareNE importCsv
importSbf importTab insert inside
inspect integer isAtom isBitVector
isBoolean isBound isByteVector isCharAlphabetic
isCharAlphanumeric isCharLowercase isCharName isCharNumeric
isCharUppercase isCharWhitespace isChar isCharacter
isComplex isDate isDictionary isDirectory
isEqual isError isEven isExact
isFloatVector isIdentical isImmediate isInexact
isInside isIntegerVector isInteger isLambda
isMatrix isMember isMoney isNegative
isNull isNumberMatrix isNumberVector isNumber
isObjectVector isObject isOdd isPair
isPcodeVector isPositive isString isStructure
isSymbol isText isTransaction isType
isVector isZero julian left
length lisp list loadModule
loadWorkspace logConsole macroReplace makeQuotedList
makeQuotedSymbol member mid minute
money month morph ncompareEQ
ncompareGE ncompareGT ncompareLE ncompareLT
ncompareNE new number offset
onError openLog pair parent
parse pointer qt quit
ref remove rename replace
rept reset right run
saveImmediate saveModule saveObject saveWorkspace
second setBlock setCar setCdr
setLastCdr set setf setq
sizeof sort sql stringCiEQ
stringCiGE stringCiGT stringCiLE stringCiLT
stringCiNE stringFill stringToBVector stringToVector
string submit substitute substringCiEQ
substringCiGE substringCiGT substringCiLE substringCiLT
substringCiNE substringEQ substringFill substringGE
substringGT substringLE substringLT substringNE
substring symbolToTypeCode symbol systemCheck
system text time trim
type uniqueInsert upcase vectorFill
version writelg writeln year

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE