Namespace: DuFile

DuFile

File related methods

Methods

staticDuFile.exists(path){boolean}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4956
Checks if the given path exists
Name Type Description
path string optional The file path
Returns:
Type Description
boolean True or false

staticDuFile.getSequenceNumber(path)

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5161
Gets the number of a frame from an file/image sequence
The number must be right before the extension.
Name Type Description
path string The path of the frame

staticDuFile.parseCSV(file, delimiter, textSeparator){Array.<string>|null}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5098
Parses a CSV file
Name Type Default Description
file File The file
delimiter string ',' optional The delimiter used
textSeparator string '"' optional The separator for texts
Returns:
Type Description
Array.<string> | null The content (a two-dimensionnal Array) or null if the file couldn't be parsed

staticDuFile.parseJSON(file){Object|null}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5066
Parses a JSON file
Name Type Description
file File The file
Returns:
Type Description
Object | null The content or null if the file couldn't be parsed

staticDuFile.read(file, encoding){string}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4985
Reads a whole file and return its content
Name Type Default Description
file File | string The file
encoding string 'UTF-8' optional The text encoding
Returns:
Type Description
string The content

staticDuFile.readFirstLine(file){string}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4969
Reads the first line of a file and return its content
Name Type Description
file File | string The file
Returns:
Type Description
string The content

staticDuFile.saveDialog(prompt, filter, defaultExtension){File|null}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5140
Shows the default save file dialog and returns the file selected by the user. If the user ommits the extension, the default extension will be appended (Mac OS fix).
Name Type Default Description
prompt string The prompt text, displayed if the dialog allows a prompt.
filter string '' optional The file type filter (windows only)
defaultExtension string '' optional The default extension
Returns:
Type Description
File | null The file or null if the user cancels

staticDuFile.saveJSON(obj, file){boolean}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5084
Saves a js object to a JSON file
Name Type Description
obj Object The object to save
file File | string The file or URI
Returns:
Type Description
boolean true if the file has been correctly written

staticDuFile.write(file, content, append, encoding){boolean}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5005
Writes a text file
Name Type Default Description
file File The file
content string The content to write
append boolean false optional Appends instead of replacing
encoding string 'UTF-8' optional The text encoding
Returns:
Type Description
boolean true if the file has been correctly written

staticDuFile.writeln(file, content, append, encoding){boolean}

D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 5037
Writes a line in a text file
Name Type Default Description
file File The file
content string The content to write
append boolean false optional Appends instead of replacing
encoding string 'UTF-8' optional The text encoding
Returns:
Type Description
boolean true if the file has been correctly written