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

dos64

Index


AllocDosObject64() ChangeFilePosition64() ChangeFileSize64() Examine64()
ExamineFH64() ExNext64() FreeDosObject64() GetFilePosition64()
GetFileSize64() Info64() IsFileSystem64() LockRecord64()
LockRecords64() Read64() Seek64() SetFileSize64()
UnLockRecord64() UnLockRecords64() Write64()  

AllocDosObject64()

Synopsis

APTR AllocDosObject64(
         ULONG type,
         const struct TagItem * tags );

APTR AllocDosObject64Tags(
         ULONG type,
         TAG tag, ... );

Function

Creates a dos object of a given type, for use with the 64-bit
dos64.library functions. Free the object with FreeDosObject64()
when done.

Inputs

type - object type (DOS64_FIB, DOS64_INFODATA, DOS64_RECORDLOCK,
       see <dos/dos64.h>)
tags - future extensions, pass NULL

Result

Pointer to the new object, or NULL on failure. IoErr() gives
additional information in that case.

ChangeFilePosition64()

Synopsis

LONG ChangeFilePosition64(
         BPTR file,
         LONG mode,
         QUAD position );

Function

Changes the current read/write position in a file with full
64-bit range. Behaves like Seek64() but returns a boolean
result instead of the previous position, matching the
AmigaOS 4 style API.

Inputs

file     - filehandle
mode     - Where to count from. Either OFFSET_BEGINNING,
           OFFSET_CURRENT or OFFSET_END.
position - relative offset in bytes (positive, negative or 0).

Result

Boolean success indicator; on DOSFALSE, IoErr() gives
additional information.

ChangeFileSize64()

Synopsis

LONG ChangeFileSize64(
         BPTR file,
         LONG mode,
         QUAD size );

Function

Change the size of a file with full 64-bit range. Behaves like
SetFileSize64() but returns a boolean result instead of the
new size, matching the AmigaOS 4 style API.

Inputs

file - filehandle
mode - OFFSET_BEGINNING, OFFSET_CURRENT or OFFSET_END
size - relative size

Result

Boolean success indicator; on DOSFALSE, IoErr() gives
additional information.

Examine64()

Synopsis

LONG Examine64(
         BPTR lock,
         struct FileInfoBlock64 * fib,
         struct TagItem * tags );

LONG Examine64Tags(
         BPTR lock,
         struct FileInfoBlock64 * fib,
         TAG tag, ... );

Function

Fill a 64-bit FileInfoBlock with information about the object
the given lock refers to.

If the filesystem does not support 64-bit examination the
request is delegated to the 32-bit Examine() and the result is
widened; sizes are then limited to what the filesystem
reports in 32 bits.

Inputs

lock - lock on the object to examine
fib  - FileInfoBlock64 to fill, allocated with
       AllocDosObject64(DOS64_FIB, NULL) or at least longword
       aligned
tags - future extensions, pass NULL

Result

Boolean success indicator. On failure IoErr() gives additional
information.

ExamineFH64()

Synopsis

LONG ExamineFH64(
         BPTR fh,
         struct FileInfoBlock64 * fib,
         struct TagItem * tags );

LONG ExamineFH64Tags(
         BPTR fh,
         struct FileInfoBlock64 * fib,
         TAG tag, ... );

Function

Fill a 64-bit FileInfoBlock with information about an open
file.

If the filesystem does not support 64-bit examination the
request is delegated to the 32-bit ExamineFH() and the result
is widened. In that case the file size is additionally
corrected through the filesystem's 64-bit size query, when it
provides one.

Inputs

fh   - filehandle to examine
fib  - FileInfoBlock64 to fill, allocated with
       AllocDosObject64(DOS64_FIB, NULL) or at least longword
       aligned
tags - future extensions, pass NULL

Result

Boolean success indicator. On failure IoErr() gives additional
information.

ExNext64()

Synopsis

LONG ExNext64(
         BPTR lock,
         struct FileInfoBlock64 * fib,
         struct TagItem * tags );

LONG ExNext64Tags(
         BPTR lock,
         struct FileInfoBlock64 * fib,
         TAG tag, ... );

Function

Examine the next entry of a directory, continuing an
enumeration started with Examine64() on the same
FileInfoBlock64.

If the filesystem does not support 64-bit examination the
request is delegated to the 32-bit ExNext() and the result is
widened; sizes are then limited to what the filesystem
reports in 32 bits.

Inputs

lock - lock on the directory being enumerated
fib  - FileInfoBlock64 as filled by the previous Examine64()
       or ExNext64() call
tags - future extensions, pass NULL

Result

Boolean success indicator. On failure IoErr() gives additional
information; ERROR_NO_MORE_ENTRIES means the enumeration is
complete.

FreeDosObject64()

Synopsis

void FreeDosObject64(
         ULONG type,
         APTR ptr );

Function

Frees an object allocated with AllocDosObject64().

Inputs

type - object type the object was allocated with
ptr  - pointer to the object; may be NULL

Result

None.

GetFilePosition64()

Synopsis

QUAD GetFilePosition64(
         BPTR file );

Function

Read the current read/write position in a file with full
64-bit range, without changing it. Buffered data on the
filehandle is taken into account.

Inputs

file - filehandle

Result

Current absolute position in bytes, or -1 if an error
happened. IoErr() will give additional information in that
case.

GetFileSize64()

Synopsis

QUAD GetFileSize64(
         BPTR file );

Function

Read the size of an open file with full 64-bit range.

If the filesystem does not support 64-bit operations the size
is obtained via ExamineFH() or, as a last resort, by seeking.

Inputs

file - filehandle

Result

Size of the file in bytes, or -1 if an error happened. IoErr()
will give additional information in that case.

Notes

Pending buffered writes on the filehandle are flushed first.

Info64()

Synopsis

LONG Info64(
         BPTR lock,
         struct InfoData64 * parameterBlock );

Function

Get information about a volume in the system, with 64-bit
block counts.

If the filesystem does not support the 64-bit query the
request is delegated to the 32-bit Info() and the result is
widened; block counts are then limited to what the filesystem
reports in 32 bits.

Inputs

lock           - a lock on any file on the volume for which
                 information should be supplied, or 0 for the
                 volume of GetFileSysTask()
parameterBlock - pointer to a longword-aligned InfoData64
                 structure

Result

Boolean indicating success or failure. If TRUE (success) the
'parameterBlock' is filled with information on the volume.

IsFileSystem64()

Synopsis

LONG IsFileSystem64(
         BPTR file );

Function

Query whether the filesystem behind an open file understands
64-bit packets, i.e. whether the 64-bit dos64.library
operations on it are handled natively rather than through
32-bit delegation.

Applications may use this to cache the capability per file and
skip 64-bit attempts on filesystems that cannot service them.

Inputs

file - filehandle to query

Result

DOSTRUE when the filesystem handles 64-bit packets, DOSFALSE
otherwise.

Notes

The query is answered with (position-neutral) probe packets;
no file state is modified.

LockRecord64()

Synopsis

BOOL LockRecord64(
         struct RecordLock64 * rec,
         ULONG timeout );

Function

Lock a portion of a file for exclusive access, with 64-bit
offsets. The record is described by a RecordLock64 structure
holding the filehandle, offset, length and locking mode. A
timeout may be specified which is the maximum amount of time
to wait for the record to become available.

If the filesystem does not support 64-bit record locking the
request is delegated to the 32-bit LockRecord(), provided the
record lies within the first 4GB of the file.

Inputs

rec     - the record to lock (rec_FH, rec_Offset, rec_Length
          and rec_Mode must be filled in)
timeout - timeout interval measured in ticks (may be 0)

Result

Success/failure indicator. On failure IoErr() gives additional
information; ERROR_OBJECT_TOO_LARGE indicates the record is
not representable on the filesystem.

Notes

Record locks are cooperative, meaning that they only affect
other calls to LockRecord()/LockRecord64().

LockRecords64()

Synopsis

BOOL LockRecords64(
         struct RecordLock64 * recArray,
         ULONG timeout );

Function

Lock several records of files for exclusive access, with
64-bit offsets. The array is terminated by an entry with
rec_FH set to NULL. If any lock in the array fails, all
already obtained locks are released again.

Inputs

recArray - array of RecordLock64 entries to lock
timeout  - timeout interval measured in ticks (may be 0),
           applied to each record

Result

Success/failure indicator. On failure IoErr() gives additional
information.

Read64()

Synopsis

QUAD Read64(
         BPTR file,
         APTR buffer,
         QUAD length );

Function

Read some data from a given file with a 64-bit length. The
request is passed to the filesystem in chunks the 32-bit
ACTION_READ packet can carry, so it works with every
filesystem - no buffering is involved.

Inputs

file   - filehandle
buffer - pointer to buffer for the data
length - number of bytes to read. The filesystem is advised
         to try to fulfill the request as well as possible.

Result

The number of bytes actually read, 0 if the end of the file
was reached, -1 if an error happened. If an error occurs after
some data has already been transferred, the number of bytes
read so far is returned and IoErr() gives the error.

Seek64()

Synopsis

QUAD Seek64(
         BPTR file,
         LONG mode,
         QUAD position );

Function

Changes the current read/write position in a file with full
64-bit range, and/or reads the current position, e.g. to get
the current position do a Seek64(file, 0, OFFSET_CURRENT).

If the filesystem does not support 64-bit operations the
request is delegated to the 32-bit Seek(), provided the
position is representable in 32 bits.

Inputs

file     - filehandle
mode     - Where to count from. Either OFFSET_BEGINNING,
           OFFSET_CURRENT or OFFSET_END.
position - relative offset in bytes (positive, negative or 0).

Result

Absolute position in bytes before the Seek64(), -1 if an error
happened. IoErr() will give additional information in that
case. If the position is not representable on the filesystem,
IoErr() returns ERROR_OBJECT_TOO_LARGE.

SetFileSize64()

Synopsis

QUAD SetFileSize64(
         BPTR file,
         LONG mode,
         QUAD offset );

Function

Change the size of a file with full 64-bit range.

If the filesystem does not support 64-bit operations the
request is delegated to the 32-bit SetFileSize(), provided the
offset is representable in 32 bits.

Inputs

file   - filehandle
mode   - OFFSET_BEGINNING, OFFSET_CURRENT or OFFSET_END
offset - relative size

Result

New size of the file or -1 in case of an error.
IoErr() gives additional information in that case. If the size
is not representable on the filesystem, IoErr() returns
ERROR_OBJECT_TOO_LARGE.

UnLockRecord64()

Synopsis

BOOL UnLockRecord64(
         struct RecordLock64 * rec );

Function

Release a record lock obtained with LockRecord64(). The
rec_FH, rec_Offset, rec_Length values must match the lock
request exactly.

Inputs

rec - the record to unlock

Result

Success/failure indicator. On failure IoErr() gives additional
information.

UnLockRecords64()

Synopsis

BOOL UnLockRecords64(
         struct RecordLock64 * recArray );

Function

Release the record locks obtained with LockRecords64(). The
array is terminated by an entry with rec_FH set to NULL.

Inputs

recArray - array of RecordLock64 entries to unlock, as passed
           to LockRecords64()

Result

Success/failure indicator. Unlocking continues over failing
entries; the result of the last failing unlock is returned and
IoErr() gives additional information.

Write64()

Synopsis

QUAD Write64(
         BPTR file,
         CONST_APTR buffer,
         QUAD length );

Function

Write some data to a given file with a 64-bit length. The
request is passed to the filesystem in chunks the 32-bit
ACTION_WRITE packet can carry, so it works with every
filesystem - no buffering is involved.

Inputs

file   - filehandle
buffer - pointer to the data to write
length - number of bytes to write.

Result

The number of bytes actually written, -1 if an error happened.
If an error occurs after some data has already been
transferred, the number of bytes written so far is returned
and IoErr() gives the error.