dash.file.new

Do setup tasks for new files


Syntax



Description

filename = dash.file.new(filename, ext, overwrite)

Gives the filename a default extension if it does not already have the extension. Throws error if the file exists and overwriting is not enabled. Returns the filename as a string.

filename = dash.file.new(filename, ext, overwrite, header)

Use a custom header for error IDs.


Input Arguments

filename

string scalar
The name of a new file

ext

string scalar | empty matrix
A default extension for the filename. If an empty matrix, does not apply a default extension.

overwrite

scalar logical
Whether existing files can be overwritten (true) or not (false).

Output Arguments

filename

string scalar
The absolute path to the new file