home *** CD-ROM | disk | FTP | other *** search
- LIBRARY NAME: DOS.ElmoreLib
- LIBRARY NUMBER: 109
- WRITTEN BY: Richard T. Elmore
-
-
-
-
-
- (For the uninitiated:)
-
-
- NOTE ON FUNCTIONS, STATEMENTS and COMMANDS:
- -------------------------------------------
-
- "FUNCTIONS" are Blitz2 tokens that require parameters in
- parentheses, and return a value:
- n=ABS(m)
-
- "STATEMENTS" are Blitz2 tokens that only perform an action
- but do not return a value. Their arguments do not require
- parentheses:
- PRINT "HELLO!"
-
- "COMMANDS" are Blitz2 tokens that can be used as either a
- FUNCTION or a STATEMENT, depending upon whether the arguments
- were in parentheses or not.
-
- [Function form:]
- n=REQUEST("TITLE","SELECT YES OR NO","YES|NO")
-
- [Statement form:]
- REQUEST "TITLE","SELECT OK TO CONTINUE","OK"
-
- ------------------------------------------------------------------------------
-
-
-
-
- Command: CHDIR
- --------------
- Syntax: CHDIR "Path:" -or- IF CHDIR("Path:") Then...
-
- This command will change the current working directory for ALL disk-
- related commands. Used as a function, a value of TRUE will be returned
- if the directory change was successful, or FALSE if it was unsuccessful.
-
-
- Function: PATHLOCK
- ------------------
- Syntax: Lock.l=PATHLOCK
-
- This function will return the BCPL pointer to the lock of the current
- directory. You should NEVER "Unlock_" this lock, but it is useful to
- use command "NameFromLock_" with it to determine the full pathname of
- the current directory, for example. (NOTE: NameFromLock_ requires 2.0
- and above!)
-
-
- Command: COPYFILE
- -----------------
- Syntax: COPYFILE "First","SECOND" -or- IF COPYFILE("FIRST","SECOND") Then...
-
- This command will copy files, much like the CLI command "Copy." In the
- function form, it will return TRUE for success, and FALSE for failure.
- Note that the speed at which it copies can be increased by increasing the
- "CopyBuffer," which defaults to 8192 bytes. (See below)
-
-
- Statement: SetCopyBuffer
- ------------------------
- Syntax: SetCopyBuffer BUFFERSIZE
-
- This statement is used to set the size of the COPYFILE command's memory
- buffer. The default size is 8192 bytes, but this can be adjusted from
- 256 bytes to nearly all your free memory. A larger buffer will normally
- increase the speed at which the COPYFILE command operates, but only up to
- the size of the largest file you're copying. For example, if the largest
- file you need to copy is 25000 bytes, then it will be useless to set the
- COPYBUFFER above 25000.
-
-
- Command: NAMEFILE
- -----------------
- Syntax: NAMEFILE "Oldname","Newname" -or-
- IF NAMEFILE("Oldname","Newname") Then...
-
- This command returns FALSE for failure, TRUE for success:
- The file "oldname" is renamed to "newname," if possible, and may be moved
- to other directories within the same volume. It is not yet possible to
- use NAMEFILE to move a file from one volume to another, however.
-
-
- Command: MAKEDIR
- ----------------
- Syntax: NAMEFILE "Path:Dir" -or- If NAMEFILE("Path:Dir") Then...
-
- This command will attempt to create a new directory with the given pathname.
- It is only possible to create one level at a time, however. For example,
- MAKEDIR will fail if you attempt to MAKEDIR "RAM:New/Data" if the directory
- "RAM:New" does not yet exist. Used as a function, MAKEDIR returns TRUE for
- success, and FALSE for failure.
-
-
- Command: MOREENTRIES
- --------------------
- Syntax: MOREENTRIES -or- If MOREENTRIES Then...
-
- This command will read the next entry in the current directory for
- inspection with other "ENTRY" commands. Used within a loop, it is easy
- to read an entire directory with these commands, similar to the "DIR" or
- "LIST" commands of AmigaDOS. (See below. An example follows)
-
-
- Function: ENTRYNAME$
- --------------------
- Syntax: n$=ENTRYNAME$
-
- This function returns the name of the current directory entry. If used
- before the fist "MOREENTRIES" command, it will return the name of the
- current directory. (Just the current directory's name, not the full
- path name)
-
-
- Function: ENTRYDIR
- ------------------
- Syntax: If ENTRYDIR Then...
-
- This function returns TRUE if the current entry is a sub-directory, or
- FALSE if it is a file.
-
-
- Function: ENTRYBITS$
- --------------------
- Syntax: n$=ENTRYBITS$
-
- This function returns a string containing the protection-bits status of
- the current file or directory. An example may be "----RWED" the same
- format as given by the AmigaDOS "LIST" command. Possible bit settings
- are HSARWED: H=HIDDEN, S=SCRIPT, A=ARCHIVED, R=READABLE, W=WRITEABLE,
- E=EXECUTEABLE, D=DELETEABLE.
- Any bits that are not set will have the "-" character in their place.
-
-
- Function: ENTRYSIZE
- -------------------
- Syntax: n.l=ENTRYSIZE
-
- This function returns the size in bytes of the current directory entry.
- Note that sub-directories return a size of zero whether they are empty
- or not.
-
-
- Function: ENTRYDATE
- -------------------
- Syntax: d$=DATE$(ENTRYDATE)
-
- This function returns the date the current entry was last modified, in
- the same format as SYSTEMDATE uses. (The number of days since 1/1/1978)
- Thus, you may use the DATE$ and DATEFORMAT commands to translate it into
- a string with a more human-readable string.
-
-
- Function: ENTRYHOUR, ENTRYMINS, ENTRYSECS
- -------------------
- Syntax: h=ENTRYHOUR:m=ENTRYMINS:s=ENTRYSECS
-
- ENTRYHOUR:
- This function is related to ENTRYDATE, above, but returns the hour of the
- day (0-23) at which the entry was last modified.
-
- ENTRYMINS:
- Returns the minute (0-59) of the time at which the entry was modified.
-
- ENTRYSECS:
- Returns the second (0-59) of the time at which the entry was modified.
-
-
-
- Function: ENTRYCOMMENT$
- -----------------------
- Syntax: c$=ENTRYCOMMENT$
-
- This function will return the string containing the filenote for the
- current directory entry, or "" if there is none.
-
-
-
- *********************
- * DIRECTORY EXAMPLE *
- *********************
-
- This example will list the entries in RAM: in a format very similar
- to the AmigaDOS "LIST" command. Note that you need to "ChDir" to
- a directory in order to read it from the first entry again.
-
-
- ChDir "RAM:"
-
- While MoreEntries
- Print LSet$(EntryName$,30)
- If EntryDIR then Print "Dir " Else Print LSet$(Str$(EntrySize),6)
- Print EntryBits$," ",Date$(EntryDate)," "
- Print EntryHour,":",Right$("0"+Str$(EntryMins),2),":"
- NPrint Right$("0"+Str$(EntrySecs),2)
- Wend
-
- MouseWait
-
-
-
-
- Command: ANALYZEDISK
- --------------------
- Syntax: ANALYZEDISK "DRIVE:" -or- If ANALYZEDISK "DRIVE:" Then...
-
- This command returns FALSE if the specified device or pathname was not
- valid. If successful, details about the specified drive can be read with
- the following "DISK" functions. The values for these functions will not
- change until ANALYZEDISK is executed again, either on the same drive or
- another one.
- Note: If given a full pathname, such as "DF0:System/Utilities" this
- command will still know enough to analyze the disk "DF0:"
-
-
- Function: DISKUNIT
- ------------------
- Syntax: n=DISKUNIT
-
- This function will return the unit number of the most recently analyzed
- disk. DF0: for example, would return zero, while DF1: would return 1.
-
-
- Function: DISKERRS
- ------------------
- Syntax: n=DISKERRS
-
- This function will return the number of soft errors DOS knows about on
- the last analyzed disk. This should normally be zero.
-
-
-
- Function: DISKCAPACITY
- ----------------------
- Syntax: n=DISKCAPACITY
-
- This function returns the capacity in bytes of the last analyzed drive.
- For example, a fastfilesystem-formatted disk's max capacity is 837K, so
- DISKCAPACITY would return 857904, which divided by 1024 is 837.
-
-
-
- Function: DISKUSED
- ------------------
- Syntax: n=DISKUSED
-
- This function returns the number of bytes actually in-use on the last
- analyzed drive.
-
-
-
- Function: DISKFREE
- ------------------
- Syntax: n=DISKFREE
-
- The opposite of DISKUSED, DISKFREE returns the number of bytes free
- on the disk. This function would be very useful, for example, in a
- program that needed to save information to disk. You would be able
- to first determine if the specified SAVE disk had sufficient space.
-
-
- Function: DISKBLOCKS
- --------------------
- Syntax: n=DISKBLOCKS
-
- This function returns the number of bytes each block on a disk uses,
- making it possible to convert the byte-values of the above functions
- to number of blocks.
-