Volume¶
Represents a kOSProcessor
hard disk or the archive.
- structure Volume¶
Suffix
Type
Description
Free space left on the volume
Total space on the volume
Get or set volume name
True if the name can be changed
Volume’s root directory
Lexicon of all files and directories on the volume
Amount of power consumed when this volume is set as the current volume
Returns true if the given file or directory exists
Creates a file
Creates a directory
Opens a file or directory
Deletes a file or directory
- Volume:NAME¶
- Type
- Access
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
- Access
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
- Access
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
VolumeItem
structures.
- Volume:ROOT¶
- Type
- Access
Get only
Returns volume’s root directory
- Volume:POWERREQUIREMENT¶
- Type
- Access
Get only
Amount of power consumed when this volume is set as the current volume
- Volume:EXISTS(path)¶
- Returns
Returns 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
VolumeItem
orBoolean
false
Opens 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
Creates 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
Creates 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.