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 Content

Name Description
Modelica.Utilities.Internal.FileSystem.mkdir mkdir Make directory (POSIX: 'mkdir')
Modelica.Utilities.Internal.FileSystem.rmdir rmdir Remove empty directory (POSIX function 'rmdir')
Modelica.Utilities.Internal.FileSystem.stat stat Inquire file information (POSIX function 'stat')
Modelica.Utilities.Internal.FileSystem.rename rename Rename existing file or directory (C function 'rename')
Modelica.Utilities.Internal.FileSystem.removeFile removeFile Remove existing file (C function 'remove')
Modelica.Utilities.Internal.FileSystem.copyFile copyFile Copy existing file (C functions 'fopen', 'fread', 'fwrite', 'fclose')
Modelica.Utilities.Internal.FileSystem.readDirectory readDirectory Read names of a directory (POSIX functions opendir, readdir, closedir)
Modelica.Utilities.Internal.FileSystem.getNumberOfFiles getNumberOfFiles Get number of files and directories in a directory (POSIX functions opendir, readdir, closedir)

Modelica.Utilities.Internal.FileSystem.mkdir Modelica.Utilities.Internal.FileSystem.mkdir

Make directory (POSIX: 'mkdir')

Information

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

Inputs

NameDescription
directoryNameMake a new directory

Modelica.Utilities.Internal.FileSystem.rmdir Modelica.Utilities.Internal.FileSystem.rmdir

Remove empty directory (POSIX function 'rmdir')

Information

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

Inputs

NameDescription
directoryNameEmpty directory to be removed

Modelica.Utilities.Internal.FileSystem.stat Modelica.Utilities.Internal.FileSystem.stat

Inquire file information (POSIX function 'stat')

Information

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

Inputs

NameDescription
nameName of file, directory, pipe etc.

Outputs

NameDescription
fileTypeType of file

Modelica.Utilities.Internal.FileSystem.rename Modelica.Utilities.Internal.FileSystem.rename

Rename existing file or directory (C function 'rename')

Information

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

Inputs

NameDescription
oldNameCurrent name
newNameNew name

Modelica.Utilities.Internal.FileSystem.removeFile Modelica.Utilities.Internal.FileSystem.removeFile

Remove existing file (C function 'remove')

Information

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

Inputs

NameDescription
fileNameFile to be removed

Modelica.Utilities.Internal.FileSystem.copyFile Modelica.Utilities.Internal.FileSystem.copyFile

Copy existing file (C functions 'fopen', 'fread', 'fwrite', 'fclose')

Information

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

Inputs

NameDescription
fromNameName of file to be copied
toNameName of copy of file

Modelica.Utilities.Internal.FileSystem.readDirectory Modelica.Utilities.Internal.FileSystem.readDirectory

Read names of a directory (POSIX functions opendir, readdir, closedir)

Information

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

Inputs

NameDescription
directoryName of the directory from which information is desired
nNamesNumber of names that are returned (inquire with getNumberOfFiles)

Outputs

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

Modelica.Utilities.Internal.FileSystem.getNumberOfFiles Modelica.Utilities.Internal.FileSystem.getNumberOfFiles

Get number of files and directories in a directory (POSIX functions opendir, readdir, closedir)

Information

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

Inputs

NameDescription
directoryDirectory name

Outputs

NameDescription
resultNumber of files and directories present in 'directory'
Automatically generated Thu Oct 1 16:08:16 2020.