Internal package with external functions as interface to the file system
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)).
Name | Description |
---|---|
mkdir | Make directory (POSIX: 'mkdir') |
rmdir | Remove empty directory (POSIX function 'rmdir') |
stat | Inquire file information (POSIX function 'stat') |
rename | Rename existing file or directory (C function 'rename') |
removeFile | Remove existing file (C function 'remove') |
copyFile | Copy existing file (C functions 'fopen', 'getc', 'putc', 'fclose') |
readDirectory | Read names of a directory (POSIX functions opendir, readdir, closedir) |
getNumberOfFiles | Get number of files and directories in a directory (POSIX functions opendir, readdir, closedir) |
Make directory (POSIX: 'mkdir')
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
directoryName | Make a new directory |
Remove empty directory (POSIX function 'rmdir')
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
directoryName | Empty directory to be removed |
Inquire file information (POSIX function 'stat')
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
name | Name of file, directory, pipe etc. |
Name | Description |
---|---|
fileType | Type of file |
Rename existing file or directory (C function 'rename')
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
oldName | Current name |
newName | New name |
Remove existing file (C function 'remove')
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
fileName | File to be removed |
Copy existing file (C functions 'fopen', 'getc', 'putc', 'fclose')
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
fromName | Name of file to be copied |
toName | Name of copy of file |
Read names of a directory (POSIX functions opendir, readdir, closedir)
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
directory | Name of the directory from which information is desired |
nNames | Number of names that are returned (inquire with getNumberOfFiles) |
Name | Description |
---|---|
names[nNames] | All file and directory names in any order from the desired directory |
Get number of files and directories in a directory (POSIX functions opendir, readdir, closedir)
Extends from Modelica.Icons.Function (Icon for functions).
Name | Description |
---|---|
directory | Directory name |
Name | Description |
---|---|
result | Number of files and directories present in 'directory' |