Paths related methods
Members
-
static,readonlyDuPath.SizeUnitstring
-
Units to use for sizes.
Properties:
Name Type Default Description BITstring b BYTEstring B KBstring kB MBstring MB GBstring GB TBstring TB
Methods
-
staticDuPath.fixName(name, placeholder){string}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4936 -
Removes all forbidden characters from a string to be used as a filename
Name Type Default Description namestring The filename to fix placeholderstring '.' optional The string used to replace the forbidden characters Returns:
Type Description string The fixed filename -
staticDuPath.getBasename(pathOrFile){String}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4842 -
Returns the basename of the given path or file
Name Type Description pathOrFileString | File optional The file or the path Returns:
Type Description String The basename Example
DuPath.getBasename(new File("D:/code/open/Duik/shape.test")) // "shape" DuPath.getBasename("D:/code/open/Duik/shape.test") // "shape" -
staticDuPath.getExtension(pathOrFile){String}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4863 -
Returns the extension of the given path or file
Name Type Description pathOrFileString | File optional The file or the path Returns:
Type Description String The extension Example
DuPath.getExtension(new File("D:/code/open/Duik/shape.other.test")) // "test" DuPath.getExtension("D:/code/open/Duik/shape.test") // "test" -
staticDuPath.getName(pathOrFile){String}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4822 -
Returns the name of the given path or file, as displayed by the filesystem
Name Type Description pathOrFileString | File | Folder optional The file or the path Returns:
Type Description String The basename Example
DuPath.getName(new File("D:\\code\\open\\Duik\\shape test.test")) // "shape test.test" DuPath.getName("D:/code/open/Duik/other shape.test") // "other shape.test" -
staticDuPath.incrementName(file){string}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4907 -
Increments the last number before the extension in a filename
Name Type Description fileFile The file Returns:
Type Description string The incremented fileName -
staticDuPath.join(parts, sep){String}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4772 -
Joins multiple paths togetther.
Name Type Default Description partsArray.<string> optional The parts to join togehter sepString "/" optional The separator to use. If not defined, will look for the first sep in the path. Returns:
Type Description String The final path -
staticDuPath.newUniqueName(newName, folder, increment){string}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4893 -
Generates a new unique name for a file
Name Type Default Description newNamestring The wanted new name folderFolder The folder incrementboolean true optional true to automatically increment the new name if it already ends with a digit Returns:
Type Description string The unique name, with a new number at the end if needed. -
staticDuPath.sizeFromBytes(size, to, decimals){float}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4794 -
Converts a number of Bytes to kB or MB or GB or TB For conversion to bits, a Byte is considered to be 8 bits.
Name Type Default Description sizeint The size in Bytes to convert toDuPath.SizeUnit DuPath.SizeUnit.MB optional The unit to convert to, one of: b, kB, MB, GB, TB decimalsint 2 optional The number of decimals to round the result Returns:
Type Description float The result of the conversion -
staticDuPath.switchExtension(pathOrFile, newExtension){String}
D:/DEV_SRC/RxOT/DuPSF/tools/output/DuPSF.jsxinc, line 4878 -
Switch the extension of the given path. Create a new path from a given path and a given extension.
Name Type Description pathOrFileString | File optional The file or the path newExtensionString optional The new extension Returns:
Type Description String The new path