Project

General

Profile

OpenSpace3D libs
OpenSpace 3D libraries for plugITs and OS3D developer

Functions

 getPathFile (longfile, file)
 Get a file path and file name from a path. More...
 
 getlastPathDir (path)
 Get the last directory from a path. More...
 
 getFileExt (file)
 Get file extension from a path. More...
 
 getFilePathWithoutExt (file)
 Get file path without the file extension. More...
 
 getFileDirectory (file)
 Get path without the file name. More...
 
 getFileNameWithoutExt (file)
 Get the file name without Path and Extension. More...
 
 getRelativePath (path, file)
 Manage relative paths (relativ files should start with ./) More...
 
 getFilesFromDir (dir, mask)
 Get the files list from a directory, with a file extension mask. More...
 
 getDirListFromPath (path)
 List the directories of a path. More...
 
 getFilesFromDirRecursive (dir)
 List the files from a directory path recursively. More...
 
 getFilesFromDirRecursive2 (dir)
 List the files from a directory path recursively case sensitive. More...
 
 cleanDirectory (dir)
 Delete all the files of a directory. More...
 
 getDirectoryWithoutLastSlash (dir)
 Remove the last '/' from a directory path. More...
 
 getDirectoryWithoutFirstSlash (dir)
 Remove the first '/' from a directory path. More...
 

Detailed Description

File tools

Function Documentation

◆ getPathFile()

getPathFile ( longfile  ,
file   
)

Get a file path and file name from a path.

Prototype: fun [S S] [S S]

Parameters
S: the path
S: set to nil
Returns
[S S] : the path and the filename

◆ getlastPathDir()

getlastPathDir ( path  )

Get the last directory from a path.

Prototype: fun [S] S

Parameters
S: the path
Returns
S : the last directory

◆ getFileExt()

getFileExt ( file  )

Get file extension from a path.

Prototype: fun [S] S

Parameters
S: the path
Returns
S : the file extension

◆ getFilePathWithoutExt()

getFilePathWithoutExt ( file  )

Get file path without the file extension.

Prototype: fun [S] S

Parameters
S: the path
Returns
S : the file path without the file extension

◆ getFileDirectory()

getFileDirectory ( file  )

Get path without the file name.

Prototype: fun [S] S

Parameters
S: the path
Returns
S : the path without the file

◆ getFileNameWithoutExt()

getFileNameWithoutExt ( file  )

Get the file name without Path and Extension.

Prototype: fun [S] S

Parameters
S: the path
Returns
S : the file name

◆ getRelativePath()

getRelativePath ( path  ,
file   
)

Manage relative paths (relativ files should start with ./)

Prototype: fun [S] S

Parameters
S: the path to add
S: the relative file path
Returns
S : the complete path

◆ getFilesFromDir()

getFilesFromDir ( dir  ,
mask   
)

Get the files list from a directory, with a file extension mask.

Prototype: fun [S [S r1]] [S r1]

Parameters
S: the path to list
[Sr1] : a list of string mask (ex : "pkg"::"bmp"::nil)
Returns
[S r1] : a list of found files

◆ getDirListFromPath()

getDirListFromPath ( path  )

List the directories of a path.

Prototype: fun [S] [S r1]

Parameters
S: the path directory
Returns
[S r1] : a list of directories

◆ getFilesFromDirRecursive()

getFilesFromDirRecursive ( dir  )

List the files from a directory path recursively.

Prototype: fun [S] [S r1]

Parameters
S: the path directory
Returns
[S r1] : a list of files

◆ getFilesFromDirRecursive2()

getFilesFromDirRecursive2 ( dir  )

List the files from a directory path recursively case sensitive.

Prototype: fun [S] [S r1]

Parameters
S: the path directory
Returns
[S r1] : a list of files

◆ cleanDirectory()

cleanDirectory ( dir  )

Delete all the files of a directory.

Prototype: fun [S] I

Parameters
S: the path directory
Returns
0

◆ getDirectoryWithoutLastSlash()

getDirectoryWithoutLastSlash ( dir  )

Remove the last '/' from a directory path.

Prototype: fun [S] I

Parameters
S: the directory path
Returns
S : the directory path without the last slash

◆ getDirectoryWithoutFirstSlash()

getDirectoryWithoutFirstSlash ( dir  )

Remove the first '/' from a directory path.

Prototype: fun [S] I

Parameters
S: the directory path
Returns
S : the directory path without the first slash