Package Modelica.​Utilities.​Internal.​FileSystem
Internal package with external functions as interface to the file system

Information

Package Internal.FileSystem is an internal package that contains low level functions as interface to the file system. These functions should not be called directly in a scripting environment since more convenient functions are provided in packages Files and Systems.

Note, the functions in this package are direct interfaces to functions of POSIX and of the standard C library. Errors occurring in these functions are treated by triggering a Modelica assert. Therefore, the functions in this package return only for a successful operation. Furthermore, the representation of a string is hidden by this interface, especially if the operating system supports Unicode characters.

Extends from Modelica.​Icons.​InternalPackage (Icon for an internal package (indicating that the package should not be directly utilized by user)).

Package Contents

NameDescription
copyFileCopy existing file (C functions 'fopen', 'getc', 'putc', 'fclose')
getNumberOfFilesGet number of files and directories in a directory (POSIX functions opendir, readdir, closedir)
mkdirMake directory (POSIX: 'mkdir')
readDirectoryRead names of a directory (POSIX functions opendir, readdir, closedir)
removeFileRemove existing file (C function 'remove')
renameRename existing file or directory (C function 'rename')
rmdirRemove empty directory (POSIX function 'rmdir')
statInquire file information (POSIX function 'stat')

Function Modelica.​Utilities.​Internal.​FileSystem.​mkdir
Make directory (POSIX: 'mkdir')

Information

This icon indicates Modelica functions.

Extends from Modelica.​Icons.​Function (Icon for functions).

Inputs

TypeNameDescription
StringdirectoryNameMake a new directory

Function Modelica.​Utilities.​Internal.​FileSystem.​rmdir
Remove empty directory (POSIX function 'rmdir')

Information

This icon indicates Modelica functions.

Extends from Modelica.​Icons.​Function (Icon for functions).

Inputs

TypeNameDescription
StringdirectoryNameEmpty directory to be removed

Function Modelica.​Utilities.​Internal.​FileSystem.​stat
Inquire file information (POSIX function 'stat')

Information

This icon indicates Modelica functions.

Extends from Modelica.​Icons.​Function (Icon for functions).

Inputs

TypeNameDescription
StringnameName of file, directory, pipe etc.

Outputs

TypeNameDescription
FileTypefileTypeType of file

Function Modelica.​Utilities.​Internal.​FileSystem.​rename
Rename existing file or directory (C function 'rename')

Information

This icon indicates Modelica functions.

Extends from Modelica.​Icons.​Function (Icon for functions).

Inputs

TypeNameDescription
StringoldNameCurrent name
StringnewNameNew name

Function Modelica.​Utilities.​Internal.​FileSystem.​removeFile
Remove existing file (C function 'remove')

Information

This icon indicates Modelica functions.

Extends from Modelica.​Icons.​Function (Icon for functions).

Inputs

TypeNameDescription
StringfileNameFile to be removed

Function Modelica.​Utilities.​Internal.​FileSystem.​copyFile
Copy existing file (C functions 'fopen', 'getc', 'putc', 'fclose')

Information

This icon indicates Modelica functions.

Extends from Modelica.​Icons.​Function (Icon for functions).

Inputs

TypeNameDescription
StringfromNameName of file to be copied
StringtoNameName of copy of file

Function Modelica.​Utilities.​Internal.​FileSystem.​readDirectory
Read names of a directory (POSIX functions opendir, readdir, closedir)

Information

This icon indicates Modelica functions.

Extends from Modelica.​Icons.​Function (Icon for functions).

Inputs

TypeNameDescription
StringdirectoryName of the directory from which information is desired
IntegernNamesNumber of names that are returned (inquire with getNumberOfFiles)

Outputs

TypeNameDescription
Stringnames[nNames]All file and directory names in any order from the desired directory

Function Modelica.​Utilities.​Internal.​FileSystem.​getNumberOfFiles
Get number of files and directories in a directory (POSIX functions opendir, readdir, closedir)

Information

This icon indicates Modelica functions.

Extends from Modelica.​Icons.​Function (Icon for functions).

Inputs

TypeNameDescription
StringdirectoryDirectory name

Outputs

TypeNameDescription
IntegerresultNumber of files and directories present in 'directory'

Generated 2018-12-12 12:14:36 EST by MapleSim.