Quasar > File system

File system


An overview of the different functions and classes:

compressfileCompresses the specified input file using LZMA encoding (7zip). This is useful for archiving larger amounts of data. Currently the file format can only be read by Quasar and by the program 7-Zip (http://www.7-zip.org). For the latter, it is necessary to open the file from the 7-Zip file menu. Then 7-Zip can always be used for decompression purposes. Alternatively, the function can be used for decompression
copyfileCopies a file from one location to another location (possibly overwritting the output file, without asking confirmation). Note that a full filename needs to be specified for output_file. An error is generated when the copying operation fails (for example, when the input file does not exist, or when the destination file is in use).
csvreadReads a matrix from a .CSV file (comma separated value file). The function can handle real-valued matrices, complex-valued matrices as well as cell matrices. The function converts the input to a suitable format. For example, if there is one field that could not be parsed as a number, a cell matrix is returned.
csvwriteWrites a matrix to a file, in the .CSV format (comma separated value file). This format can easily be opened in spreadsheet applications. In this format, all matrix elements are stored as strings that are separated by a comma value. Each row is printed on a separate line.
decompressfileDecompresses the specified input file that was compressed using the function . Only LZMA encoded files can be decompressed.
deletefileDeletes the specified filename (without asking confirmation). Be careful to not accidentally delete files, because the files are not moved to the garbage bin folder!
dirLists all files in a given directory according to the specification
dirsepReturns the directory separator character for the current platform (for windows, this is "\" while for linux/mac this is "/")
existChecks whether the specified file or directory exist.
fcloseCloses the specified file (that was previously opened using )
feofIndicates whether the end of the specified file has been reached.
fgetposGets the current position in the file (that was previously opened using )
fgetsReads one single text line from a file opened in text mode
filepartsObtains the fileparts (directory, filename, extension) of a file path. For example, for `fileparts("/tmp/outputlog/output.log")` the output is:
fopenOpens the specified file for reading or writing. The file handle must be closed using
fprintPrints text to a file (opened in text mode)
fprintfPrints C-style formatted text to a file (opened in text mode)
freadReads binary data from a file (opened in binary mode)
fscanfReads C-style formatted text from a file (opened in text mode)
fsetposSets the current position in the file (that was previously opened using )
fullpathReturns the full absolute path information for a given file name. This function is typically used for relative file paths.
fwriteWrites binary data to a file (opened in binary mode)
imreadReads an image input file.
imwrite (1)Saves an image as a file
imwrite (2)Saves an image as a file
isrelativepathIndicates whether the specified filename has a relative or an absolute path. For example `file.txt` or `../file.txt` are relative paths, while `/tmp/file.txt` is an absolute path. The function can be used for converting to absolute paths.
loadLoads variables from a file
makepathBuilds a path name based on different components. For example,
mkdirRecursively creates a new directory: when necessary, parent directories are created too.
movefileMoves a file from one location to another location (possibly overwritting the output file, without asking confirmation). Note that a full filename needs to be specified for output_file. An error is generated when the copying operation fails (for example, when the input file does not exist, or when the destination file is in use).
printfC-like printing to the console
pwdIdentifies the current Quasar directory.
quasardirRetrieves a specific Quasar directory
saveSaves variables to a file
sprintfC-like string formatting
sscanfParses a string using C-style formatting rules
uigetdirShows a dialog box to select a directory.
uigetfileShows a file open dialog box, to select a file from the hard disk
uiputfileShows a file save dialog box, to select a file from the hard disk for saving. The dialog box requests an overwrite confirmation when the selected file already exists