• Dchroot | Changes the root directory for the calling process. |
• Dclosedir | Closes a directory. |
• Dcntl | File-system-specific operation on file/directory. |
• Dcreate | Creates a directory. |
• Ddelete | Deletes a directory. |
• Dfree | Obtains free and total capacity of a drive. |
• Dgetcwd | Obtains directory of a process. |
• Dgetdrv | Obtains current drive. |
• Dgetpath | Obtains current directory. |
• Dlock | Locks or releases again a BIOS device. |
• Dopendir | Opens a directory for reading. |
• Dpathconf | Obtains information about a file-system. |
• Dreaddir | Reads directory information. |
• Dreadlabel | Reads file-system label. |
• Drewinddir | Rewinds opened directory pointer. |
• Dsetdrv | Sets current drive. |
• Dsetkey | Sets key/passphrase for a drive. |
• Dsetpath | Sets current directory. |
• Dwritelabel | Sets file-system label. |
• Dxopendir | Opens directory for reading. |
• Dxreaddir | Reads directory information, obtains attributes. |
See also: File functions XBIOS drive functions
Name: | »Dchroot« - Change the root directory for the calling
process.
|
Opcode: | 330 (0x014a)
|
Syntax: | int32_t Dchroot( int8_t *path );
|
Description: | The path parameter is a pathname of the folder that
will be the new root directory for the calling process. Directories
and files which are outside of the specified tree will no longer be
accessible.
Dchroot does not automatically change the current directory to the newly specified root. Also, the call needs root privileges to operate properly. This function is used by e.g. ftpd to limit the user privileges in accessing file-systems. |
Return value: | Returns the E_OK on success, or a negative GEMDOS error-code
otherwise.
|
Availability | As of FreeMiNT version 1.15.4
|
Group: | Directories functions
|
See also: | Binding Dopendir Dreaddir MagiC
|
C: | int32_t Dchroot( int8_t *path );
|
Assembler: |
pea path ; Offset 2 move.w #330,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #6,sp ; Correct stack |
Name: | »Dclosedir« - Close a specified directory.
|
Opcode: | 299
|
Syntax: | int32_t Dclosedir ( int32_t dirhandle );
|
Description: | The function Dclosedir closes the directory with the handle
dirhandle.
|
Return value: | The function returns the value 0 if the directory could be
closed correctly. If dirhandle is invalid, then the value
EBADF will be returned.
|
Availability: | Available when a 'MiNT' cookie with a version of at least 0.90
exists, and MagiC as of Version 3.0.
|
Group: | Directory functions
|
See also: | Binding Dopendir Dreaddir MagiC
|
C: | int32_t Dclosedir ( int32_t dirhandle );
|
Assembler: |
move.l dirhandle,-(sp) ; Offset 2 move.w #299,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #6,sp ; Correct stack |
Name: | »Dcntl« - Execute a file-system-specific operation on a file
or a directory.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Opcode: | 304
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Syntax: | int32_t Dcntl ( int16_t cmd, int8_t *name, int32_t arg );
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description: | The function Dcntl executes the command cmd on the file
or the directory name. Details depend on the file-system to
which name refers. The meaning of the parameter arg is
in turn dependent on cmd.
Normally the Dcntl call is supported by the file-systems U:\\ and U:\DEV. The unified file-system U:\ knows the following commands:
The file-system U:\DEV knows the following commands:
Note: The opcodes marked with (*) here are only available under MagiC, all others only under MiNT or MultiTOS. Exceptions: The opcodes FUTIME and CDROMEJECT are avaiable both under MiNT/MultiTOS as well as under MagiC. (1): Unfortunately there were collisions between MagiC and the Minix-XFS for MiNT. Hence MagiC as of Version 6 contains new codes, though the old ones are still supported. The new codes have 0x6d in the upper WORD; this ID is reserved for MagiC. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return value: | The return value depends on the desired operation and the
underlying file-system. With a value >= 0 everything was
successful. An exception is the value for DEV_INSTALL, which either
points to an information structure of the kernel, or else has the
value 0.
For an invalid opcode, EINVFN will be returned. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Availability: | Available when a 'MiNT' cookie with a version of at least 0.90
exists, and MagiC as of Version 3.0.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Group: | Directory functions
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See also: | Binding XFS-concept in MagiC Bconmap Fcntl MagiC Metaioctl
|
C: | int32_t Dcntl ( int16_t cmd, int8_t *name, int32_t arg );
|
Assembler: |
move.l arg,-(sp) ; Offset 8 pea name ; Offset 4 move.w cmd,-(sp) ; Offset 2 move.w #304,-(sp) ; Offset 0 trap #1 ; GEMDOS lea $C(sp),sp ; Correct stack |
Name: | »Create directory« - Create a directory.
| ||||||
Opcode: | 57
| ||||||
Syntax: | int32_t Dcreate ( CONST int8_t *path );
| ||||||
Description: | The GEMDOS routine Dcreate creates a directory with the
pathname path, which has to be terminated with the ASCII
character 0, on the specified drive.
Note: Due to defective error-handling in GEMDOS Versions < 0.15, the file-system could be damaged in some circumstances. Furthermore, no check was made whether a file with the specified name already exists. Atari GEMDOS Reference Manual from April 4, 1986 warns about passing paths ending with a trailing backslash and indeed, the function fails at least on TOS 1.0x in such case with EPTHNF. As of MagiC 3, the call is passed on by the kernel as xfs_dcreate with creation mode Fxattr %0100000111101101 (i.e. a 'directory file' with access permissions RWXRwXRwX). The XFS should not delete any files or subdirectories of the same name, but return the error-code EACCDN in this case. Invalid filenames "." or ".." must also be intercepted by the XFS. | ||||||
Return value: | The function can return the following results:
| ||||||
Availability: | All GEMDOS versions.
| ||||||
Group: | Directory functions
| ||||||
See also: | Binding Ddelete ASCII table
|
C: | int32_t Dcreate ( CONST int8_t *path );
|
Assembler: |
pea path ; Offset 2 move.w #57,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #6,sp ; Correct stack |
GFA-Basic | Fehler%=Gemdos(&H39,L:path%)
|
Name: | »Delete directory« - Delete a directory.
| ||||||||
Opcode: | 58
| ||||||||
Syntax: | int32_t Ddelete ( CONST int8_t *path );
| ||||||||
Description: | The GEMDOS routine Ddelete deletes a directory with the
pathname path, which may not contain any files or
subdirectories. The string path must be terminated with the
ASCII character 0.
Note: In GEMDOS Versions < 0.15 a call of Dcreate with an immediately following Ddelete did not work - only a further Ddelete achieved the desired result. In MagiC the kernel first checks whether the directory is a current path and if appropriate returns an error-message. If possible, only empty directories should be deleted; this is however up to the XFS. As of MagiC Version 4.01, symbolic links too can be deleted with this function; older versions always deleted the directory to which the link pointed. | ||||||||
Return value: | The function can return the following results:
| ||||||||
Availability: | All GEMDOS versions.
| ||||||||
Group: | Directory functions
| ||||||||
See also: | Binding Dcreate XFS-concept in MagiC
|
C: | int32_t Ddelete ( CONST int8_t *path );
|
Assembler: |
pea path ; Offset 2 move.w #58,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #6,sp ; Correct stack |
GFA-Basic | Fehler%=Gemdos(&H3A,L:path%)
|
Name: | »Free disk space« - Obtain free and total capacity of a
drive.
| ||||||||||||||
Opcode: | 54
| ||||||||||||||
Syntax: | int16_t Dfree ( DISKINFO *buf, int16_t driveno );
| ||||||||||||||
Description: | The GEMDOS routine Dfree obtains the capacity and current
occupancy of a drive. The following apply:
Note: In GEMDOS Versions < 0.15 this function is unbelievably slow when used on a hard drive. Applied to the directory U:\PROC, from MagiC 3 onwards this function returns the minimum, actual block length (as sectors per cluster). Presently the memory is allocated word-wise, i.e. the 'sector size' is 1 int8_t and the cluster size comprises 2 sectors (i.e. 2 int8_ts). | ||||||||||||||
Return value: | The function returns a 0 for a correct execution, or a negative
number if an error arose.
| ||||||||||||||
Availability: | All GEMDOS versions.
| ||||||||||||||
Group: | Directory functions
| ||||||||||||||
See also: | Binding Fdelete
|
C: | int16_t Dfree ( DISKINFO *buf, int16_t driveno );
|
Assembler: |
move.w driveno,-(sp) ; Offset 6 pea buf ; Offset 2 move.w #54,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #8,sp ; Correct stack |
GFA-Basic | Fehler%=Gemdos(&H36,L:buf%,W:driveno%)
|
Name: | »Dgetcwd« - Obtain the current directory of a process.
|
Opcode: | 315
|
Syntax: | int32_t Dgetcwd ( int8_t *path, int16_t drv, int16_t size );
|
Description: | The current working directory of the active process in drive
drv is returned. The parameter size gives the size of
the buffer for accommodating the name.
|
Return value: | path: Directory of the current process.
The return value of the function is either 0 (all OK), ERANGE (the size of the buffer is insufficient to hold the exact description of the directory), or EDRIVE (invalid GEMDOS ignore} drive). |
Availability: | Available when a 'MiNT' cookie with a version of at least 0.96
exists, and MagiC as of Version 3.0.
|
Group: | Directory functions
|
See also: | Binding Dgetpath
|
C: | int32_t Dgetcwd ( int8_t *path, int16_t drv, int16_t size );
|
Assembler: |
move.w size,-(sp) ; Offset 8 move.w drv,-(sp) ; Offset 6 pea path ; Offset 2 move.w #315,-(sp) ; Offset 0 trap #1 ; GEMDOS lea $A(sp),sp ; Correct stack |
Name: | »Disk get drive« - Obtain the current drive.
| ||||||||||||
Opcode: | 25
| ||||||||||||
Syntax: | int16_t Dgetdrv ( VOID );
| ||||||||||||
Description: | The GEMDOS routine Dgetdrv obtains the current drive.
| ||||||||||||
Return value: | The function returns a number, which is coded as follows:
Note: As of MagiC 3, drives from A: to Z:, i.e. values from 0 to 25, are permissible. | ||||||||||||
Availability: | All GEMDOS versions.
| ||||||||||||
Group: | Directory functions
| ||||||||||||
See also: | Binding Dsetdrv _drvbits
|
C: | int16_t Dgetdrv ( VOID );
|
Assembler: |
move.w #25,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #2,sp ; Correct stack |
GFA-Basic | Fehler%=Gemdos(&H19)
|
Name: | »Get path« - Obtain current path specification.
| ||||||||||||
Opcode: | 71
| ||||||||||||
Syntax: | int16_t Dgetpath ( int8_t *path, int16_t driveno );
| ||||||||||||
Description: | The GEMDOS routine Dgetpath obtains the current directory on
the drive driveno. The designation of the drives are coded in
the parameter driveno as follows:
The path is stored in buffer path as a string. As the maximum path length is not restricted in GEMDOS, and can be obtained only with the existence of the function Dpathconf, the receiving buffer should offer sufficient space (256 bytes ought to be enough). | ||||||||||||
Return value: | The function can return the following results:
| ||||||||||||
Availability: | All GEMDOS versions.
| ||||||||||||
Group: | Directory functions
| ||||||||||||
See also: | Binding Dsetpath
|
C: | int16_t Dgetpath ( int8_t *path, int16_t driveno );
|
Assembler: |
move.w driveno,-(sp) ; Offset 6 pea path ; Offset 2 move.w #71,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #8,sp ; Correct stack |
GFA-Basic | Fehler%=Gemdos(&H47,L;path%,W:driveno%)
|
Name: | »Dlock« - Lock a BIOS device or releases it again.
| ||||||||||
Opcode: | 309
| ||||||||||
Syntax: | int32_t Dlock ( int16_t mode, int16_t drv );
| ||||||||||
Description: | The function Dlock permits the locking of the BIOS device
drv, or releasing it again. On a locked drive no GEMDOS file
operations are permitted; Rwabs is only allowed for the locking
process.
The purpose of the function is to allow low-level programs (such as those for formatting) to perform (X)BIOS functions, while the device remains locked for normal file accesses.
If a process is terminated that still holds a lock on a device, then this lock will be lifted. Bit 1 of mode indicates which return values are desired. If this bit is set, and the corresponding device is already locked by another process (or if another process has opened files on this device), then this process' ID will be returned. This permits more meaningful error-messages to the user, as one can now disclose which process is using the device if the locking should go wrong. All other bits of mode are reserved and must be set to 0. Locking of a device with immediately following release of the same is very similar to a media change. One should merely note that it is not possible to lock if files are still open on the specified device. Note for MagiC: Before locking of the drive, provided a file-system exists for the drive, the caches will be written back via the vector xfs_sync. Then the kernel inquires via xfs_drv_close whether the drive may be locked. If so, the XFS releases its structures and then signals the kernel that it too can release its structures for the drive, and perform the lock. | ||||||||||
Return value: | The function can return the following values:
| ||||||||||
Availability: | Available when a 'MiNT' cookie with a version of at least 0.93
exists, and MagiC as of Version 3.0.
| ||||||||||
Group: | Directory functions
| ||||||||||
See also: | Binding Fxattr XFS-concept in MagiC
|
C: | int32_t Dlock ( int16_t mode, int16_t drv );
|
Assembler: |
move.w drv,-(sp) ; Offset 4 move.w mode,-(sp) ; Offset 2 move.w #309,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #6,sp ; Correct stack |
Name: | »Dopendir« - Open a specified directory for reading.
| ||||||||
Opcode: | 296
| ||||||||
Syntax: | int32_t Dopendir ( int8_t *name, int16_t flag );
| ||||||||
Description: | The function Dopendir opens the directory name for
reading. name should be NULL-terminated and should not contain
a trailing backslash. The parameter flag describes the manner
in which the directory is to be opened:
Newer programs should always use the normal mode if possible, in order to exploit the full functionaity. | ||||||||
Return value: | The function returns a 32-bit directory handle if successful;
this may also be negative, but in no case may contain the value 0xff
in the higher byte, through which it can be differentiated from
errors.
In case of error, the following returns are possible:
| ||||||||
Availability: | Available when a 'MiNT' cookie with a version of at least 0.90
exists, and in MagiC as of Version 3.0.
| ||||||||
Group: | Directory functions
| ||||||||
See also: | Binding Dclosedir Dreaddir Drewinddir Pdomain
|
C: | int32_t Dopendir ( int8_t *name, int16_t flag );
|
Assembler: |
move.w flag,-(sp) ; Offset 6 pea name ; Offset 2 move.w #296,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #8,sp ; Correct stack |
Name: | »Dpathconf« - Obtain information about a file-system.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Opcode: | 292
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Syntax: | int32_t Dpathconf ( BYTE *name, int16_t mode );
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description: | The function Dpathconf makes it possible to obtain information
about the file-system that contains the file name.
The parameter mode specifies which possibilities or restrictions of the file-systems are to be inquired. Possible values here are:
A return value of 0x7fffffff (2^31 -1) means that there is no limit for the component inquired about. Note: In MagiC the function can also be applied to files. However the filename is ignored in this case, i.e. only the path will be evaluated. The function should be called in MagiC after Dopendir if necessary, as Dpathconf does not recognise disk changes (reason: if the path is still in the cache, no disk access is performed and hence no disk change is recognised). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return value: | The function returns the properties/limitations of the
file-system paying regard to the parameter mode (see above).
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Availability: | As of the first in MultiTOS integrated MiNT version 1.04, and
in MagiC as of Version 3.0.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Group: | Directory functions
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See also: | Binding Sysconf XFS-concept in MagiC Test for pipes
|
C: | int32_t Dpathconf ( BYTE *name, int16_t mode );
|
Assembler: |
move.w mode,-(sp) ; Offset 6 pea name ; Offset 2 move.w #292,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #8,sp ; Correct stack |
Name: | »Dreaddir« - Read directory information.
| ||||||
Opcode: | 297
| ||||||
Syntax: | int32_t Dreaddir ( int16_t len, int32_t dirhandle, int8_t *buf
);
| ||||||
Description: | The function Dreaddir returns the next file in the directory
dirhandle. The filename and an optional 4-byte index for the
file are written to buf.
The file index is omitted if the directory was opened im compatibility mode, otherwise it appears as the first in buf followed by a (NULL-terminated) filename. (Possibly different) names with the same index belong to the same file. (Possibly same) names with different indexes belong to different files. Note about MagiC: For FAT file-systems the function returns the following index data:
This procedure is similar to that used by Linux and Solaris. The drawback is that files alter their index during a move. In len the size of the receiving buffers has to be specified. | ||||||
Return value: | The function can return the following results:
| ||||||
Availability: | Available when a 'MiNT' cookie with a version of at least 0.90
exists, and in MagiC as of Version 3.0.
| ||||||
Group: | Directory functions
| ||||||
See also: | Binding Dclosedir Dopendir Drewinddir Dxreaddir
|
C: | int32_t Dreaddir ( int16_t len, int32_t dirhandle, int8_t *buf
);
|
Assembler: |
pea buf ; Offset 8 move.l dirhandle ; Offset 4 move.w len ; Offset 2 move.w #297,-(sp) ; Offset 0 trap #1 ; GEMDOS lea $C(sp),sp ; Correct stack |
Name: | »Dreadlabel« - Read file-system label.
| ||||
Opcode: | 338 (0x0152)
| ||||
Syntax: | int32_t Dreadlabel ( CONST int8_t *path, int8_t *label, int16_t
length );
| ||||
Description: | The function Dreadlabel returns in label the name of
the file-system lying in path. The parameter length
specifies the size of the receiving buffer for label.
| ||||
Return value: | The function can return the following results:
| ||||
Availability: | In MagiC as of Version 3.0, from MiNT 1.12 onwards.
| ||||
Group: | Directory functions
| ||||
See also: | Binding Dwritelabel XFS-concept in MagiC
|
C: | int32_t Dreadlabel ( CONST int8_t *path, int8_t *label, int16_t
length );
|
Assembler: |
move.w length,-(sp) ; Offset 10 pea label ; Offset 6 pea path ; Offset 2 move.w #338,-(sp) ; Offset 0 trap #1 ; GEMDOS lea $C(sp),sp ; Correct stack |
Name: | »Drewinddir« - Rewind the pointer for the specified directory
to the first file.
| ||||||
Opcode: | 298
| ||||||
Syntax: | int32_t Drewinddir ( int32_t handle );
| ||||||
Description: | The function Drewinddir resets the directory handle to
the start, so that the next call of Dreaddir reads the first entry in
the directory once more.
| ||||||
Return value: | The function can return the following results:
| ||||||
Availability: | Available when a 'MiNT' cookie with a version of at least 0.90
exists, and in MagiC as of Version 3.0.
| ||||||
Group: | Directory functions
| ||||||
See also: | Binding Dopendir Dreaddir
|
C: | int32_t Drewinddir ( int32_t handle );
|
Assembler: |
move.l handle,-(sp) ; Offset 2 move.w #298,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #6,sp ; Correct stack |
Name: | »Disk set drive« - Set the current drive and returns a
bit-map of mounted drives.
| ||||||||||
Opcode: | 14
| ||||||||||
Syntax: | int32_t Dsetdrv ( int16_t drv );
| ||||||||||
Description: | The GEMDOS routine Dsetdrv makes the drive drv the
current default drive. The following apply:
Note: An incorrect drive number can lead to serious damage in GEMDOS-internal structures. The drives supported by GEMDOS are best interrogated as follows: Dsetdrv (Dgetdrv ()); As of MagiC 3, drives from A to Z, i.e. values from 0 to 25 are permissible. No check is made whether the specified drive even exists. GEMDOS 0.30 (TOS 4.00-4.04) returns erroneous EDRIVEs for drives above P:! | ||||||||||
Return value: | Return value: The function returns a bit-table with all
mounted drives. Each mounted drive is shown as one set bit.
| ||||||||||
Availability: | All GEMDOS versions.
| ||||||||||
Group: | Directory functions
| ||||||||||
See also: | Binding Dgetdrv _drvbits
|
C: | int32_t Dsetdrv ( int16_t drv );
|
Assembler: |
move.w drv,-(sp) ; Offset 2 move.w #14,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #4,sp ; Correct stack |
GFA-Basic | Fehler%=Gemdos(&H0E,W:drv%)
|
Name: | »Set key« - Set the key/passphrase for a drive.
| ||||||||
Opcode: | 333 (0x014d)
| ||||||||
Syntax: | int32_t Dsetkey ( int32_t hidev, int32_t lowdev, int8_t *key,
int16_t cipher );
| ||||||||
Description: | The GEMDOS routine Dsetkey set the key/passphrase for the drive
specified by hidev and lowdev. Drive will be
deferenced if it is an alias.
The parameter key is a pointer to the new passhrase; if this is an empty string, ciphering will be disabled for the drive; if it is a NULL pointer, the function checks the current ciphering mode. The parameter cipher specifies the cipher type to use. Currently, only zero (Blowfish) is supported. Other values are reserved for future expansion. As changing the key directly influences data access, the drive is Dlock()ed during this process to prevent data loss. | ||||||||
Return value: | If key is NULL, the function returns 0 if ciphering is
disabled on dev, or any other value if ciphering is enabled.
If key is not NULL, the following return values are possible:
| ||||||||
Availability: | This function is available as of FreeMiNT 1.15.4.
| ||||||||
Group: | Directory functions
| ||||||||
See also: | Binding
|
C: | int32_t Dsetkey ( int32_t hidev, int32_t lowdev, int8_t *key,
int16_t cipher );
|
Assembler: |
move.w cipher,-(sp) ; Offset 14 pea key ; Offset 10 move.l lowdev,-(sp) ; Offset 6 move.l hidev,-(sp) ; Offset 2 move.w #333,-(sp) ; Offset 0 trap #1 ; GEMDOS lea 16(sp),sp ; Correct stack |
GFA-Basic | Fehler%=Gemdos(&H14D,L:hidev%,L:lowdev%,L:key%,W:cipher%)
|
Name: | »Set path« - Set the current directory.
| ||||
Opcode: | 59
| ||||
Syntax: | int16_t Dsetpath ( CONST int8_t *path );
| ||||
Description: | The GEMDOS routine Dsetpath sets a new access path for the
current drive. The parameter path contains the new current
access path for the drive.
Note: For each drive, GEMDOS will remember the current directory. However, the function Dsetpath should be used only for the current drive. For other drives the following method should be applied instead:
On some (older) versions of GEMDOS, a too frequent setting of non-existing paths can lead to disturbance in the internal structures. | ||||
Return value: | The function can return the following results:
| ||||
Availability: | All GEMDOS versions.
| ||||
Group: | Directory functions
| ||||
See also: | Binding Dgetpath
|
C: | int16_t Dsetpath ( CONST int8_t *path );
|
Assembler: |
pea path ; Offset 2 move.w #59,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #6,sp ; Correct stack |
GFA-Basic | Fehler%=Gemdos(&H3B,L:path%)
|
Name: | »Dwritelabel« - Set file-system label.
|
Opcode: | 339 (0x0153)
|
Syntax: | int32_t Dwritelabel ( CONST int8_t *path, CONST int8_t *label
);
|
Description: | The function Dwritelabel writes the name specified in
label to the file-system specified in path.
Prior to MiNT version 1.14.5 this call contained a bug that allowed the label to be changed by all users. |
Return value: | E_OK if successful, else a negative GEMDOS error-code.
|
Availability: | MagiC as of Version 3.0, MiNT 1.12
|
Group: | Directory functions
|
See also: | Binding Dreadlabel XFS-concept in MagiC
|
C: | int32_t Dwritelabel ( CONST int8_t *path, CONST int8_t *label
);
|
Assembler: |
pea label ; Offset 6 pea path ; Offset 2 move.w #339,-(sp) ; Offset 0 trap #1 ; GEMDOS lea $A(sp),sp ; Correct stack |
Name: | »Dxopendir« - Open directory for reading.
| ||||||||
Opcode: | 1296
| ||||||||
Syntax: | int32_t Dxopendir ( int8_t *name, int16_t flag );
| ||||||||
Description: | Dxopendir calls the normal Dopendir, but then saves the
returned handle and flag in a chained list, so that Dreaddir and
Dxreaddir know what they have to convert for this directory.
Dcloseddir deletes the handle again from the list.
Dreaddir and Dxreaddir convert the returned name to lower case. The function opens the directory name for reading. The parameter flag describes the manner how the directory is to be opened:
Newer programs should always use the normal mode if possible, in order to exploit the full functionaity. | ||||||||
Return value: | The function returns a 32-bit directory handle if successful;
this may also be negative, but in no case may contain the value 0xff
in the higher byte, through which it can be differentiated from
errors.
In case of error, the following returns are possible:
| ||||||||
Availability: | When the system extension Dir_Lwr (supplied with Égale 4.2) is
installed. Creates the cookie 'DYDL'.
| ||||||||
Group: | Directory functions
| ||||||||
See also: | Binding Dclosedir Dreaddir Drewinddir Pdomain
|
C: | int32_t Dxopendir ( int8_t *name, int16_t flag );
|
Assembler: |
move.w flag,-(sp) ; Offset 6 pea name ; Offset 2 move.w #1296,-(sp) ; Offset 0 trap #1 ; GEMDOS addq.l #8,sp ; Correct stack |
Name: | »Dxreaddir« - Read directory information, obtain attributes.
| ||||||
Opcode: | 322, (0x142)
| ||||||
Syntax: | int32_t Dxreaddir ( int16_t ln, int32_t dirh, int8_t *buf,
XATTR *xattr, int32_t *xr );
| ||||||
Description: | The function Dxreaddir returns the next file from the directory
with the handle dirh. The filename and the optional 4 byte
long file index are stored in the buffer specified in buf.
The file index is omitted if the compatibility mode was specified for Dopendir. If two filenames have the same index, they represent the same file. MagiC returns for FAT file-systems the following index data:
This procedure is similar to that used by Linux and Solaris. The drawback is that files alter their index during a move. The parameter ln specifies the length of the receiving buffer buf. The extended file attributes are stored similarly to Fxattr in the xattr structure, where symbolic links are not dissolved. Note: This part of the call may fail even though the filename was readable. In that case a separate return code will be stored in the LONG value to which the parameter xr points. | ||||||
Return value: | The function can return the following results:
| ||||||
Availability: | MagiC as of Version 3.0, MiNT 1.11 onwards.
| ||||||
Group: | Directory functions
| ||||||
See also: | Binding Dreaddir Dopendir Dclosedir Drewinddir
|
C: | int32_t Dxreaddir ( int16_t ln, int32_t dirh, int8_t *buf,
XATTR *xattr, int32_t *xr );
|
Assembler: |
pea xr ; Offset 16 pea xattr ; Offset 12 pea buf ; Offset 8 move.l dirh ; Offset 4 move.w ln ; Offset 2 move.w #322,-(sp) ; Offset 0 trap #1 ; GEMDOS lea $14(sp),sp ; Correct stack |