Volume¶
Represents a kOSProcessor hard disk or the archive.
-
structure
Volume¶ Suffix Type Description FREESPACEScalarFree space left on the volume CAPACITYScalarTotal space on the volume NAMEStringGet or set volume name RENAMEABLEScalarTrue if the name can be changed ROOTVolumeDirectoryVolume’s root directory FILESLexiconLexicon of all files and directories on the volume POWERREQUIREMENTScalarAmount of power consumed when this volume is set as the current volume EXISTS(path)BooleanReturns true if the given file or directory exists CREATE(path)VolumeFileCreates a file CREATEDIR(path)VolumeDirectoryCreates a directory OPEN(path)VolumeItemorBooleanOpens a file or directory DELETE(path)BooleanDeletes a file or directory
-
Volume:
NAME¶ Type: StringAccess: Get and Set Gets or sets volume name. This name can be used instead of the volumeId with some file and volume-related commands
-
Volume:
RENAMEABLE¶ Type: BooleanAccess: Get only True if the name of this volume can be changed. Currently only the name of the archive can’t be changed.
-
Volume:
FILES¶ Type: LexiconofVolumeItemAccess: Get only List of files and directories on this volume. Keys are the names of all items on this volume and values are the associated
VolumeItemstructures.
-
Volume:
ROOT¶ Type: VolumeDirectoryAccess: Get only Returns volume’s root directory
-
Volume:
POWERREQUIREMENT¶ Type: ScalarAccess: Get only Amount of power consumed when this volume is set as the current volume
-
Volume:
EXISTS(path)¶ Returns: BooleanReturns true if the given file or directory exists. This will also return true when the given file does not exist, but there is a file with the same name and .ks or .ksm extension added. Use
Volume:FILES:HASKEY(name)to perform a strict check.Paths passed as the argument to this command should not contain a volume id or name and should not be relative.
-
Volume:
OPEN(path)¶ Returns: VolumeItemorBooleanfalseOpens the file or directory pointed to by the given path and returns
VolumeItem. It will return a boolean false if the given file or directory does not exist.Paths passed as the argument to this command should not contain a volume id or name and should not be relative.
-
Volume:
CREATE(path)¶ Returns: VolumeFileCreates a file under the given path and returns
VolumeFile. It will fail if the file already exists.Paths passed as the argument to this command should not contain a volume id or name and should not be relative.
-
Volume:
CREATEDIR(path)¶ Returns: VolumeDirectoryCreates a directory under the given path and returns
VolumeDirectory. It will fail if the directory already exists.Paths passed as the argument to this command should not contain a volume id or name and should not be relative.
-
Volume:
DELETE(path)¶ Returns: boolean Deletes the given file or directory (recursively). It will return true if the given item was successfully deleted and false otherwise.
Paths passed as the argument to this command should not contain a volume id or name and should not be relative.