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

dosrelative

Index


CreateDirRelative() DeleteFileRelative() GetDeviceProcRelative() IsFileSystemRelative()
LockRelative() MakeLinkRelative() OpenRelative() RenameRelative()
SetCommentRelative() SetFileDateRelative() SetOwnerRelative() SetProtectionRelative()

CreateDirRelative()

Synopsis

BPTR CreateDirRelative(
         BPTR lock,
         CONST_STRPTR name );

Function

Creates a new directory under the given name, resolving a
relative name against the given directory lock instead of the
current directory of the calling process. If all went well, an
exclusive lock on the new directory is returned.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/CreateDir().

Inputs

lock - directory lock to resolve a relative name against,
       or NULL for the current directory
name - NUL terminated name.

Result

Exclusive lock to the new directory or 0 if it couldn't be
created. IoErr() gives additional information in that case.

Notes

This call is AROS-specific.

DeleteFileRelative()

Synopsis

BOOL DeleteFileRelative(
         BPTR lock,
         CONST_STRPTR name );

Function

Tries to delete a file or directory, resolving a relative name
against the given directory lock instead of the current
directory of the calling process. May fail if the file is in
use or protected from deletion.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/DeleteFile().

Inputs

lock - directory lock to resolve a relative name against,
       or NULL for the current directory
name - NUL terminated name of the file or directory.

Result

DOSTRUE if the object was deleted, DOSFALSE otherwise.
IoErr() gives additional information in that case.

Notes

This call is AROS-specific.

GetDeviceProcRelative()

Synopsis

struct DevProc * GetDeviceProcRelative(
         BPTR lock,
         CONST_STRPTR name,
         struct DevProc * dp );

Function

GetDeviceProcRelative() will find the filesystem handler which
you should send a command to for a specific path, and the lock
the path is relative to. For a relative name the result refers
to the handler owning the given lock, with the lock itself as
dvp_Lock; a packet built from it names the object exactly as
LockRelative() would.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/GetDeviceProc(), including the
iteration over the targets of a multi-directory assign.

The first call should have the |dp| parameter as NULL. Passing
a previous result continues an iteration; a result obtained for
a name relative to a lock has no further entries.

Inputs

lock - directory lock to resolve a relative name against,
       or NULL for the current directory
name - Name of the object to find.
dp   - Previous result of GetDeviceProcRelative() or NULL.

Result

A pointer to a DevProc structure containing the information
required to send a command to a filesystem, or NULL with IoErr()
set. Release it with dos.library/FreeDeviceProc().

Notes

This call is AROS-specific.

IsFileSystemRelative()

Synopsis

BOOL IsFileSystemRelative(
         BPTR lock,
         CONST_STRPTR name );

Function

Query whether the handler that would service a path is a
filesystem. For a name relative to lock that is the handler
owning the lock.

If name is absolute (names a volume, device or assign, or begins
with ':'), or is the console alias "*", lock is ignored. If lock
is NULL, the name is resolved against the current directory. In
both cases the call behaves exactly like
dos.library/IsFileSystem().

Inputs

lock - directory lock to resolve a relative name against,
       or NULL for the current directory
name - Name of the object or device to query.

Result

TRUE if the handler is a filesystem, FALSE otherwise.

Notes

This call is AROS-specific.

DF0:, HD0:, ... are filesystems. CON:, PIPE:, AUX:, ... are not.

LockRelative()

Synopsis

BPTR LockRelative(
         BPTR lock,
         CONST_STRPTR name,
         LONG accessMode );

Function

Gets a lock on a file or directory, resolving a relative name
against the given directory lock instead of the current
directory of the calling process.

The name is handed to the filesystem together with the lock, so
the object is located in a single filesystem operation: no path
string is assembled, and a link in the path cannot be retargeted
by another process between the lookup and the lock.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/Lock().

Inputs

lock       - directory lock to resolve a relative name against,
             or NULL for the current directory
name       - NUL terminated name of the file or directory.
accessMode - One of SHARED_LOCK
                    EXCLUSIVE_LOCK

Result

Handle to the file or directory or 0 if the object couldn't be
locked. IoErr() gives additional information in that case.

Notes

This call is AROS-specific. It is the equivalent of the POSIX
*at() family's directory-relative name resolution.

Soft links are followed as by Lock(), up to the same nesting
limit; a link target without a volume specifier is itself
resolved relative to lock.

MakeLinkRelative()

Synopsis

LONG MakeLinkRelative(
         BPTR lock,
         CONST_STRPTR name,
         SIPTR dest,
         LONG soft );

Function

MakeLinkRelative() will create a link between two files or
directories, resolving a relative link name against the given
directory lock instead of the current directory of the calling
process. A link is a filesystem object that refers to another
file.

A soft link refers to another file or directory by name, and is
resolved by the filesystem and the caller. Soft links are not
restricted to the same volume and the target does not have to
exist. The target name is stored as given; a relative target is
later resolved against the directory holding the link.

A hard link refers to another file by the location on a disk,
and is resolved by the filesystem. Hard links are restricted to
files or directories on the same volume.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/MakeLink().

Inputs

lock - directory lock to resolve a relative link name against,
       or NULL for the current directory
name - The name of the link to create
dest - If 'soft' is TRUE this must be a filename; if it is FALSE
       a lock pointing to the file to be hard-linked must be
       provided
soft - TRUE, if a soft link is to be created, FALSE for a hard
       link

Result

boolean - DOSTRUE or DOSFALSE. On error, IoErr() will contain
more information.

Notes

This call is AROS-specific.

OpenRelative()

Synopsis

BPTR OpenRelative(
         BPTR lock,
         CONST_STRPTR name,
         LONG accessMode );

Function

Opens a file for read and/or write depending on the accessmode
given, resolving a relative name against the given directory
lock instead of the current directory of the calling process.

The name is handed to the filesystem together with the lock, so
the file is located and opened in a single filesystem operation.

If name is absolute (names a volume, device or assign, or begins
with ':'), or is one of the console aliases ("*", "CONSOLE:"),
lock is ignored. If lock is NULL, the name is resolved against
the current directory. In both cases the call behaves exactly
like dos.library/Open().

Inputs

lock       - directory lock to resolve a relative name against,
             or NULL for the current directory
name       - NUL terminated name of the file.
accessMode - One of MODE_OLDFILE   - open existing file
                    MODE_NEWFILE   - delete old, create new file
                                     exclusive lock
                    MODE_READWRITE - open new one if it doesn't exist

Result

Handle to the file or 0 if the file couldn't be opened.
IoErr() gives additional information in that case.

Notes

This call is AROS-specific.

Soft links are followed as by Open(), up to the same nesting
limit; a link target without a volume specifier is itself
resolved relative to lock.

RenameRelative()

Synopsis

LONG RenameRelative(
         BPTR oldLock,
         CONST_STRPTR oldName,
         BPTR newLock,
         CONST_STRPTR newName );

Function

Renames a given file, resolving each relative name against its
own directory lock instead of the current directory of the
calling process. The old name and the new name must point to the
same volume.

Both names, with their locks, are handed to the filesystem in a
single rename operation; no path string is assembled for either
side.

A name that is absolute (names a volume, device or assign, or
begins with ':') ignores its lock. A name whose lock is NULL is
resolved against the current directory. When this applies to
both names the call behaves exactly like dos.library/Rename().

Inputs

oldLock - directory lock to resolve a relative oldName against,
          or NULL for the current directory
oldName - Name of the file to rename
newLock - directory lock to resolve a relative newName against,
          or NULL for the current directory
newName - New name of the file to rename

Result

boolean - DOSTRUE or DOSFALSE. IoErr() provides additional
information on DOSFALSE.

Notes

This call is AROS-specific.

Relative names are passed to the filesystem as written; unlike
dos.library/Rename(), no canonical path is built for a name
holding a parent reference (a/b//c). The filesystem resolves
such a reference against the lock it is given.

SetCommentRelative()

Synopsis

LONG SetCommentRelative(
         BPTR lock,
         CONST_STRPTR name,
         CONST_STRPTR comment );

Function

Change the comment on a file or directory, resolving a relative
name against the given directory lock instead of the current
directory of the calling process. The comment may be any
NUL-terminated string. The supported size varies from filesystem
to filesystem. In order to clear an existing comment, an empty
string should be specified.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/SetComment().

Inputs

lock    - directory lock to resolve a relative name against,
          or NULL for the current directory
name    - name of the file
comment - new comment for the file.

Result

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

Notes

This call is AROS-specific.

SetFileDateRelative()

Synopsis

BOOL SetFileDateRelative(
         BPTR lock,
         CONST_STRPTR name,
         const struct DateStamp * date );

Function

Set the modification date of a file or directory, resolving a
relative name against the given directory lock instead of the
current directory of the calling process.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/SetFileDate().

Inputs

lock - directory lock to resolve a relative name against,
       or NULL for the current directory
name - name of the file
date - new modification date.

Result

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

Notes

This call is AROS-specific.

SetOwnerRelative()

Synopsis

BOOL SetOwnerRelative(
         BPTR lock,
         CONST_STRPTR name,
         ULONG owner_info );

Function

Set the owner of a file or directory, resolving a relative name
against the given directory lock instead of the current
directory of the calling process.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/SetOwner().

Inputs

lock       - directory lock to resolve a relative name against,
             or NULL for the current directory
name       - name of the file
owner_info - the user id in the upper 16 bits and the group id
             in the lower 16 bits.

Result

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

Notes

This call is AROS-specific.

SetProtectionRelative()

Synopsis

LONG SetProtectionRelative(
         BPTR lock,
         CONST_STRPTR name,
         ULONG protect );

Function

Set the protection bits of a file or directory, resolving a
relative name against the given directory lock instead of the
current directory of the calling process.

If name is absolute (names a volume, device or assign, or begins
with ':'), lock is ignored. If lock is NULL, the name is resolved
against the current directory. In both cases the call behaves
exactly like dos.library/SetProtection().

Inputs

lock    - directory lock to resolve a relative name against,
          or NULL for the current directory
name    - name of the file
protect - new protection bits (FIBF_*).

Result

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

Notes

This call is AROS-specific.