file

file

factory file

Description:
  • Specifies the file system specific functions.

    • These functions are accessible via the aidesys:: prefix.

Methods

(static) readDir(path, patternopt) → {Array.<string>}

Description:
  • Lists all files of a directory.

Parameters:
Name Type Attributes Default Description
path string

The directory to list.

pattern string <optional>
".*"

The file pattern regular expression using the ECMAScript syntax.

Returns:

A std::vector<std::string> structure with the file names.

  • The file base names with file extension and without the directory path are provided.
Type
Array.<string>

(static) getFileTime()

Description:
  • Gets the file last modificaton time, in milliseconds.

    • Returns NAN, if the file does not exists: std::isnan(aidesys::getFileTime(file)) is equivalent to sys:exists(file).

(static) exists(file) → {bool}

Description:
  • Checks if a file exists. * ```

Parameters:
Name Type Description
file string

The file path name.

Returns:

True if the file exists and is readable, false otherwise.

Type
bool

(static) load(file) → {string}

Description:
  • Loads a textual file.

Parameters:
Name Type Description
file string

The file path name.

Returns:

The file contents as a string.

Type
string

(static) save(file, string)

Description:
  • Loads a textual file.

Parameters:
Name Type Description
file string

The file path name.

string string

The file contents as a string.

(static) gnuplot(file, plot, dataopt)

Description:
  • Generated a gnuplot interface display script.

Parameters:
Name Type Attributes Default Description
file string

The related data file name (without extension). By contract,

  • the file basename is used as the plot title;
  • the display script is generated in $file.gnuplot.sh.
  • the plot image is generated in $file.png.
  • the data is stored in a $file.dat.

To display the gnuplot, run $file.gnuplot.sh.

plot string

The gnuplot display commands.

data string <optional>
""

An optional string with the plot data.