Skip to content

Commit

Permalink
Update Volume documentation page
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekpiotrowski committed May 12, 2016
1 parent b05a5d6 commit 05527a5
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions doc/source/structures/volumes_and_files/volume.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ Represents a :struct:`kOSProcessor` hard disk or the archive.
- Description

* - :attr:`FREESPACE`
- :ref:`scalar <scalar>`
- :struct:`Scalar`
- Free space left on the volume

* - :attr:`CAPACITY`
- :ref:`scalar <scalar>`
- :struct:`Scalar`
- Total space on the volume

* - :attr:`NAME`
- :ref:`String`
- :struct:`String`
- Volume name

* - :attr:`RENAMEABLE`
- :ref:`scalar <scalar>`
- :struct:`Scalar`
- True if the name can be changed

* - :attr:`ROOT`
Expand All @@ -41,11 +41,11 @@ Represents a :struct:`kOSProcessor` hard disk or the archive.
- Lexicon of all files and directories on the volume

* - :attr:`POWERREQUIREMENT`
- :ref:`scalar <scalar>`
- :struct:`Scalar`
- Amount of power consumed when this volume is set as the current volume

* - :meth:`EXISTS(path)`
- :ref:`boolean <boolean>`
- :struct:`Boolean`
- Returns true if the given file or directory exists

* - :meth:`CREATE(path)`
Expand All @@ -57,42 +57,41 @@ Represents a :struct:`kOSProcessor` hard disk or the archive.
- Creates a directory

* - :meth:`OPEN(path)`
- :struct:`VolumeItem`
- :struct:`VolumeItem` or :struct:`Boolean`
- Opens a file or directory

* - :meth:`DELETE(path)`
- :ref:`boolean <boolean>`
- :struct:`Boolean`
- Deletes a file or directory

.. attribute:: Volume:FREESPACE

:type: :ref:`scalar <scalar>`
:type: :struct:`Scalar`
:access: Get only

Free space left on the volume

.. attribute:: Volume:CAPACITY

:type: :ref:`scalar <scalar>`
:type: :struct:`Scalar`
:access: Get only

Total space on the volume

.. attribute:: Volume:NAME

:type: :ref:`String`
:type: :struct:`String`
:access: Get only

Volume name. This name can be used instead of the volumeId with some :ref:`file and volume-related commands<files>`

.. attribute:: Volume:RENAMEABLE

:type: :ref:`boolean <boolean>`
:type: :struct:`Boolean`
:access: Get only

True if the name of this volume can be changed. Currently only the name of the archive can't be changed.


.. attribute:: Volume:FILES

:type: :struct:`Lexicon` of :struct:`VolumeItem`
Expand All @@ -109,40 +108,49 @@ Represents a :struct:`kOSProcessor` hard disk or the archive.

.. attribute:: Volume:POWERREQUIREMENT

:type: :ref:`scalar <scalar>`
:type: :struct:`Scalar`
:access: Get only

Amount of power consumed when this volume is set as the current volume


.. method:: Volume:EXISTS(path)

:return: :struct:`Boolean`

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.

.. method:: Volume:OPEN(path)

:return: :struct:`VolumeItem`
:return: :struct:`VolumeItem` or :struct:`Boolean` false

Opens the file or directory pointed to by the given path and returns :struct:`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.

.. method:: Volume:CREATE(path)

:return: :struct:`VolumeFile`

Creates a file under the given path and returns :struct:`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.

.. method:: Volume:CREATEDIR(path)

:return: :struct:`VolumeDirectory`

Creates a directory under the given path and returns :struct:`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.

.. method:: Volume:DELETE(path)

:return: 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.

0 comments on commit 05527a5

Please sign in to comment.