Project

General

Profile

OpenSpace3D libs
OpenSpace 3D libraries for plugITs and OS3D developer
Loading...
Searching...
No Matches

Functions

 getPathFile (longfile, file)
 Get a file path and file name from a path.
 
 getlastPathDir (path)
 Get the last directory from a path.
 
 getFileExt (file)
 Get file extension from a path.
 
 getFilePathWithoutExt (file)
 Get file path without the file extension.
 
 getFileDirectory (file)
 Get path without the file name.
 
 getFileNameWithoutExt (file)
 Get the file name without Path and Extension.
 
 getRelativePath (path, file)
 Manage relative paths (relativ files should start with ./)
 
 createFolder (path)
 Create a new folder.
 
 getShortName (name)
 Compute a name with only allowed char from a string.
 
 getFilesFromDir (dir, mask)
 Get the files list from a directory, with a file extension mask.
 
 getFilesFromDirFilter (dir, mask, cbfilter)
 Get the files list from a directory, with a file extension mask and filter.
 
 getFilesFromDir2 (dir, mask)
 Get the files list from a directory, with a file extension mask and case sensitive.
 
 getFilesFromDirFilter2 (dir, mask, cbfilter)
 Get the files list from a directory, with a file extension mask and case sensitive and filter.
 
 getFilesNamesFromDir (dir, mask)
 Get the files names list from a directory, with a file extension mask.
 
 getFilesNamesFromDir2 (dir, mask)
 Get the files names list from a directory, with a file extension mask and case sensitive.
 
 sanitizeFileName (file)
 Replace spaces in a file name and removes special characters that are unsupported on some platforms.
 
 getDirListFromPath (path)
 List the directories of a path.
 
 getFilesFromDirRecursive (dir)
 List the files from a directory path recursively.
 
 getFilesFromDirFilterRecursive (dir, mask, cbfilter)
 Get the files list from a directory, with a file extension mask and filter recursively.
 
 getFilesFromDirRecursive2 (dir)
 List the files from a directory path recursively case sensitive.
 
 getFilesFromDirFilterRecursive2 (dir, mask, cbfilter)
 Get the files list from a directory, with a file extension mask and case sensitive and filter recursively.
 
 cleanDirectory (dir)
 Delete all the files of a directory.
 
 getDirectoryWithoutLastSlash (dir)
 Remove the last '/' from a directory path.
 
 getDirectoryWithoutFirstSlash (dir)
 Remove the first '/' from a directory path.
 

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

◆ createFolder()

createFolder ( path  )

Create a new folder.

Prototype: fun [S] S

Parameters
S: the path to add
Returns
I : 1 on succes, 0 otherwise

◆ getShortName()

getShortName ( name  )

Compute a name with only allowed char from a string.

Prototype: fun [S] S

Parameters
S: original string
Returns
I : 1 on succes, 0 otherwise

◆ 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

◆ getFilesFromDirFilter()

getFilesFromDirFilter ( dir  ,
mask  ,
cbfilter   
)

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

Prototype: fun [S [S r1] fun [S] I ] [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

◆ getFilesFromDir2()

getFilesFromDir2 ( dir  ,
mask   
)

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

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

◆ getFilesFromDirFilter2()

getFilesFromDirFilter2 ( dir  ,
mask  ,
cbfilter   
)

Get the files list from a directory, with a file extension mask and case sensitive and filter.

Prototype: fun [S [S r1] fun [S] I ] [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

◆ getFilesNamesFromDir()

getFilesNamesFromDir ( dir  ,
mask   
)

Get the files names 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 names

◆ getFilesNamesFromDir2()

getFilesNamesFromDir2 ( dir  ,
mask   
)

Get the files names list from a directory, with a file extension mask and case sensitive.

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 names

◆ sanitizeFileName()

sanitizeFileName ( file  )

Replace spaces in a file name and removes special characters that are unsupported on some platforms.

Prototype: fun [S] S

Parameters
S: the path to sanitize
Returns
[S r1] : path with sanitized file name

◆ 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

◆ getFilesFromDirFilterRecursive()

getFilesFromDirFilterRecursive ( dir  ,
mask  ,
cbfilter   
)

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

Prototype: fun [S [S r1] fun [S] I ] [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

◆ 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

◆ getFilesFromDirFilterRecursive2()

getFilesFromDirFilterRecursive2 ( dir  ,
mask  ,
cbfilter   
)

Get the files list from a directory, with a file extension mask and case sensitive and filter recursively.

Prototype: fun [S [S r1] fun [S] I ] [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

◆ 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