Topic : The GFA-Basic Compendium Author : GFA Systemtechnik GmbH Version : GFABasic.HYP v2.98 (12/31/2023) Subject : Documentation/Programming Nodes : 899 Index Size : 28056 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : @default : Document not found @help : Help @options : +g -i -s +z @width : 75 @hostname : STRNGSRV @hostname : CAB @hostname : HIGHWIRE @hostname : THING View Ref-FileDFREE(n) CHDRIVE n CHDRIVE n$ DIR$(n) CHDIR name$ n: iexp n$, name$: sexp DFREE() (disk free) returns the amount of space free for storage on drive n in bytes. This can take a few seconds, or longer with a partitioned hard disk drive. See CHDRIVE below for the meaning of the parameter n. CHDRIVE (Change Drive) sets the default disk drive. This is the drive which is used by DIR etc. if no other drive is specified. Any drive can be made the default drive with CHDRIVE followed by the drive number from 0 to 16. Drive 0 corresponds to the current default drive, drive 1 corresponds to A:, drive 2 to B:, etc. The argument of CHDRIVE may also be a string, in which case the first character (from A to P) identifies the drive. DIR$(n) returns as a string the current access path for drive n, as set with CHDIR below. See CHDRIVE above for the meaning of the parameter n. CHDIR sets the current directory. Since the default drive cannot be changed with CHDIR, the specified directory must be on the current default drive or a specified drive. So, after CHDIR "B:\TEST", the directory TEST on drive B: becomes the current directory, which may be accessed without the need to specify the path 'B:\TEST'. With CHDIR "\", one can return to the root directory from any sub-directory. The directory required is always looked for as a sub-directory of the current directory. Thus if, after making B:TEST the current directory as above, one issued the command CHDIR "TEST2", the effective path from the root directory would be B:\TEST\TEST2. There are two special folder names: '.' aud '..', which are shorthand ways of referring to the 'current' directory path and the 'parent' directory path respectively. The parent path is that which leads up to, but does not include, the current directory. For instance, with the path 'B:\TEST\TEST2' above, the parent path is 'B:\TEST'. Thus to change the current directory to another on the same level, perhaps TEST2A, it is only necessary to type CHDIR "..\TEST2A". Examples: CHDRIVE 1 PRINT DFREE(0) PRINT DIR$(2) CHDRIVE "C:\" --> Disk drive A: is selected as the current default drive, and its free storage capacity is printed. Then the current access path for drive B: is printed, and finally drive C: is made the current default drive. CHDIR "\" CHDIR "TEXT.DOC\MANUAL" CHDIR "APPENDIX" --> CHDIR "\" sets the current directory to be the root directory of the current drive. In the second line MANUAL, which is a sub-directory of the sub-directory TEXT.DOC, is made the current directory. In the third line a further sub-directory APPENDIX is made the current directory, so that the access path is now \TEXT.DOC\MANUAL\APPENDIX. Memo: DFREE() will fail on large capacity drives, internally it uses word values. Call GEMDOS(54) directly to get a more accurate value. Due the limits of a long%, drives larger than 2gb are still a problem. DIR$() does not report invalid drive identifiers. Dfree()+, Dgetdrv()+, Dsetdrv()+, Dgetpath()+, Dsetpath()+