<--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../aros.css' --->

partition

Index


AddBootFileSystem() ClosePartitionTable() CloseRootPartition() FindFileSystemA()
GetFileSystemAttrsA() GetPartitionAttrs() GetPartitionTableAttrs() LoadBootFileSystems()
LoadFileSystem() OpenPartitionTable() OpenRootPartition() QueryPartitionAttrs()
QueryPartitionTableAttrs() ReadPartitionDataQ()    

AddBootFileSystem()

Synopsis

LONG AddBootFileSystem(
         struct Node * handle );

Function

Adds the specified filesystem to the system list of bootable
filesystems (actually FileSystem.resource).

Inputs

handle - Filesystem handle obtained by FindFileSystemA()

Result

Zero if everything went okay or common dos.library-compliant error code.

Notes

This function can be called during system startup before dos.library
is available. In this case filesystem loading will be delayed until
dos.library started up. Delayed loading will be handled automatically
without any caller's intervention.

ClosePartitionTable()

Synopsis

void ClosePartitionTable(
         struct PartitionHandle * root );

Function

Close a partition table (and discard all changes). All partitions
and subpartitions in root->list will be removed recursively.

Inputs

root - partition table to close

CloseRootPartition()

Synopsis

void CloseRootPartition(
         struct PartitionHandle * ph );

Function

Close a root handle allocated by OpenRootPartition().

Inputs

ph - root handle created by OpenRootPartition()

FindFileSystemA()

Synopsis

struct Node * FindFileSystemA(
         struct PartitionHandle * table,
         const struct TagItem * taglist );

struct Node * FindFileSystem(
         struct PartitionHandle * table,
         TAG tag, ... );

Function

Locate a filesystem handler in the partition.

Inputs

ph      - PartitionHandle to the table
taglist - Taglist specifying arguments. Possible tags are:

      FST_ID   - specify ID of the filesystem.
      FST_NAME - specify name of the filesystem.

      If more than one condition is specified for the search, logical
      AND will be applied to them. Empty taglist will give you the
      first filesystem in the list.

Result

Abstract handle of a filesystem or NULL if the filesystem with the
given parameters was not located in the partition.

GetFileSystemAttrsA()

Synopsis

void GetFileSystemAttrsA(
         struct Node * handle,
         const struct TagItem * taglist );

void GetFileSystemAttrs(
         struct Node * handle,
         TAG tag, ... );

Function

get attributes of a partition table

Inputs

handle      - Filesystem handle
taglist - list of attributes; unknown tags are ignored

Tags

FST_ID      (ULONG *)           - Get 4-character FS ID
FST_NAME    (STRPTR *)          - Get a pointer to FS name
FST_FSENTRY (struct FileSysEntry *) - Fill in given FileSysEntry.

Result

None.

Notes

Name is returned as a pointer to an internally allocated string. You
should copy it if you want to keep it after the filesystem's
partition table handle has been closed.

The following fields in struct FileSysEntry will not be filled in:
  - Node name
  - fse_Handler
  - fse_SegList
You need to query for the filesystem's name separately and copy it
into a BSTR yourself, if you need to. Loading the handler is done by
the LoadFileSystem() function.

GetPartitionAttrs()

Synopsis

LONG GetPartitionAttrs(
         struct PartitionHandle * ph,
         const struct TagItem * taglist );

LONG GetPartitionAttrsTags(
         struct PartitionHandle * ph,
         TAG tag, ... );

Function

Get attributes of a partition.

Inputs

ph      - PartitionHandle
taglist - list of attributes, unknown tags are ignored

Tags

PT_GEOMETRY (struct DriveGeometry *)
    Fill in DriveGeometry structure
PT_DOSENVEC (struct DosEnvec *)
    Fill in DosEnvec structure
PT_TYPE (struct PartitionType *)
    Get partition type
PT_POSITION (ULONG *)
    Get position (entry number) of partition within its table.
    Returns -1 if there's no table (e.g. if used on disk root)
PT_ACTIVE (LONG *)
    Get value of "active" flag (PC-MBR specific)
PT_BOOTABLE (LONG *)
    Get value of "bootable" flag
PT_AUTOMOUNT (LONG *)
    Get value of "automount" flag
PT_NAME (STRPTR)
    Get name of partition (max 31 Bytes + NUL-byte)
PT_STARTBLOCK (UQUAD *)
    Get number of starting block for the partition (V2)
PT_ENDBLOCK (UQUAD *)
    Get number of ending block for the partition (V2)

Result

Currently reserved, always zero.

Notes

Nested partition tables (e.g. RDB subpartitions on PC MBR drive) are
treated as virtual disks. In this case start and end block numbers are
relative to the beginning of the virtual disk (which is represented by
a parent partition containing the RDB itself), not absolute numbers.
The same applies to DriveGeomerty and geometry-related fields in the
DosEnvec structure.

Note that geometry data can be stored on disk in the partition table
ifself (RDB for example), and this way it may not match the physical
device's geometry (for example, if the disk was partitioned on
another operating system which used virtual geometry). In this case
you might need to adjust these data in order to mount the file system
correctly (if absolute start/end blocks are not cylinder-aligned).

Starting from V2, partition.library always provides default values
for all attributes, even for those not listed as readable in
QueryPartitionAttrs() results.

GetPartitionTableAttrs()

Synopsis

LONG GetPartitionTableAttrs(
         struct PartitionHandle * root,
         const struct TagItem * taglist );

LONG GetPartitionTableAttrsTags(
         struct PartitionHandle * root,
         TAG tag, ... );

Function

Get attributes of a partition table.

Inputs

ph      - PartitionHandle of the partition table
taglist - list of attributes; unknown tags are ignored

Tags

PTT_TYPE (ULONG *)
    Get partition table type
PTT_MAXLEADIN (LONG *)
PTT_RESERVED (ULONG *)
    Get number of reserved blocks

PTT_FIRSTUSABLE, PTT_LASTUSABLE (UQUAD *)
    Inclusive usable block range, excluding partition metadata.
    QueryPartitionTableAttrs() indicates support for these tags.

LoadBootFileSystems()

Synopsis

LONG LoadBootFileSystems();

Function

Perform a deferred loading of boot filesystems.

Inputs

None.

Result

Zero if everything went okay or DOS error code in case of failure.

Notes

This function is actually private; it's called by dos.library during
the initialization process. There's no sense to call it from within
user software.

LoadFileSystem()

Synopsis

BPTR LoadFileSystem(
         struct Node * handle );

Function

Load the specified filesystem as a DOS segment list.

Inputs

handle - Filesystem handle obtained by FindFileSystemA()

Result

DOS seglist or NULL in case of failure.

OpenPartitionTable()

Synopsis

LONG OpenPartitionTable(
         struct PartitionHandle * root );

Function

Open a partition table. On success root->list will be filled with a
list of PartitionHandles. If one partition contains more
subpartitions, the caller should call OpenPartitionTable() on the
PartitionHandle recursively.

Inputs

root - root partition

Result

0 for success; an error code otherwise.

OpenRootPartition()

Synopsis

struct PartitionHandle * OpenRootPartition(
         CONST_STRPTR Device,
         LONG Unit );

Function

Create a root handle by opening a trackdisk-compatible device.

Inputs

Device - name of the block device
Unit - unit of the block device

Result

Handle to the device

QueryPartitionAttrs()

Synopsis

const struct PartitionAttribute * QueryPartitionAttrs(
         struct PartitionHandle * table );

Function

Query partition attributes.

Inputs

ph      - PartitionHandle to the table

Result

List of NULL-terminated ULONGs with attributes.

QueryPartitionTableAttrs()

Synopsis

const struct PartitionAttribute * QueryPartitionTableAttrs(
         struct PartitionHandle * table );

Function

Query partition table attributes.

Inputs

ph - PartitionHandle of a partition table

Result

List of NULL-terminated ULONGs with attributes.

ReadPartitionDataQ()

Synopsis

LONG ReadPartitionDataQ(
         struct PartitionHandle * Partition,
         APTR Buffer,
         ULONG DataSize,
         UQUAD StartBlock );

Function

Read raw data from the partition.

Inputs

Partition  - a handle to a partition to read from
Buffer     - a pointer to a data buffer
DataSize   - Size of data to read in bytes. This size must be a
             multiple of block size in order to ensure correct
             operation
StartBlock - Number of the first block to start reading from

Result

Return code of DoIO() function which was used to read the data.

Docutils System Messages

System Message: ERROR/3 (/home/vsts/work/1/b/documentation/html/documentation/developers/autodocs/partition.en.rst, line 330); backlink

Unknown target name: "setpartitionattrs()".