home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Basic / OTL-BBU2.DMS / in.adf / Elmore / DOS.ElmoreLib.DOC < prev    next >
Encoding:
Text File  |  1994-04-04  |  8.0 KB  |  278 lines

  1.   LIBRARY NAME:  DOS.ElmoreLib
  2. LIBRARY NUMBER:  109
  3.     WRITTEN BY:  Richard T. Elmore
  4.  
  5.  
  6.  
  7.  
  8.  
  9. (For the uninitiated:)
  10.  
  11.  
  12. NOTE ON FUNCTIONS, STATEMENTS and COMMANDS:
  13. -------------------------------------------
  14.  
  15. "FUNCTIONS" are Blitz2 tokens that require parameters in
  16. parentheses, and return a value:
  17. n=ABS(m)
  18.  
  19. "STATEMENTS" are Blitz2 tokens that only perform an action
  20. but do not return a value.  Their arguments do not require
  21. parentheses:
  22. PRINT "HELLO!"
  23.  
  24. "COMMANDS" are Blitz2 tokens that can be used as either a
  25. FUNCTION or a STATEMENT, depending upon whether the arguments
  26. were in parentheses or not.
  27.  
  28. [Function form:]
  29. n=REQUEST("TITLE","SELECT YES OR NO","YES|NO")
  30.  
  31. [Statement form:]
  32. REQUEST "TITLE","SELECT OK TO CONTINUE","OK"
  33.  
  34. ------------------------------------------------------------------------------
  35.  
  36.  
  37.  
  38.  
  39. Command: CHDIR
  40. --------------
  41. Syntax: CHDIR "Path:"  -or-  IF CHDIR("Path:") Then...
  42.  
  43. This command will change the current working directory for ALL disk-
  44. related commands.  Used as a function, a value of TRUE will be returned
  45. if the directory change was successful, or FALSE if it was unsuccessful.
  46.  
  47.  
  48. Function: PATHLOCK
  49. ------------------
  50. Syntax: Lock.l=PATHLOCK
  51.  
  52. This function will return the BCPL pointer to the lock of the current
  53. directory.  You should NEVER "Unlock_" this lock, but it is useful to
  54. use command "NameFromLock_" with it to determine the full pathname of
  55. the current directory, for example.  (NOTE: NameFromLock_ requires 2.0
  56. and above!)
  57.  
  58.  
  59. Command: COPYFILE
  60. -----------------
  61. Syntax: COPYFILE "First","SECOND"  -or-  IF COPYFILE("FIRST","SECOND") Then...
  62.  
  63. This command will copy files, much like the CLI command "Copy."  In the
  64. function form, it will return TRUE for success, and FALSE for failure.
  65. Note that the speed at which it copies can be increased by increasing the
  66. "CopyBuffer," which defaults to 8192 bytes.  (See below)
  67.  
  68.  
  69. Statement: SetCopyBuffer
  70. ------------------------
  71. Syntax: SetCopyBuffer BUFFERSIZE
  72.  
  73. This statement is used to set the size of the COPYFILE command's memory
  74. buffer.  The default size is 8192 bytes, but this can be adjusted from
  75. 256 bytes to nearly all your free memory.  A larger buffer will normally
  76. increase the speed at which the COPYFILE command operates, but only up to
  77. the size of the largest file you're copying.  For example, if the largest
  78. file you need to copy is 25000 bytes, then it will be useless to set the
  79. COPYBUFFER above 25000.
  80.  
  81.  
  82. Command: NAMEFILE
  83. -----------------
  84. Syntax: NAMEFILE "Oldname","Newname"  -or-
  85.         IF NAMEFILE("Oldname","Newname") Then...
  86.  
  87. This command returns FALSE for failure, TRUE for success:
  88. The file "oldname" is renamed to "newname," if possible, and may be moved
  89. to other directories within the same volume.  It is not yet possible to
  90. use NAMEFILE to move a file from one volume to another, however.
  91.  
  92.  
  93. Command: MAKEDIR
  94. ----------------
  95. Syntax: NAMEFILE "Path:Dir"  -or-  If NAMEFILE("Path:Dir") Then...
  96.  
  97. This command will attempt to create a new directory with the given pathname.
  98. It is only possible to create one level at a time, however.  For example,
  99. MAKEDIR will fail if you attempt to MAKEDIR "RAM:New/Data" if the directory
  100. "RAM:New" does not yet exist.  Used as a function, MAKEDIR returns TRUE for
  101. success, and FALSE for failure.
  102.  
  103.  
  104. Command: MOREENTRIES
  105. --------------------
  106. Syntax: MOREENTRIES  -or-  If MOREENTRIES Then...
  107.  
  108. This command will read the next entry in the current directory for
  109. inspection with other "ENTRY" commands.  Used within a loop, it is easy
  110. to read an entire directory with these commands, similar to the "DIR" or
  111. "LIST" commands of AmigaDOS.  (See below.  An example follows)
  112.  
  113.  
  114. Function: ENTRYNAME$
  115. --------------------
  116. Syntax: n$=ENTRYNAME$
  117.  
  118. This function returns the name of the current directory entry.  If used
  119. before the fist "MOREENTRIES" command, it will return the name of the
  120. current directory.  (Just the current directory's name, not the full
  121. path name)
  122.  
  123.  
  124. Function: ENTRYDIR
  125. ------------------
  126. Syntax: If ENTRYDIR Then...
  127.  
  128. This function returns TRUE if the current entry is a sub-directory, or
  129. FALSE if it is a file.
  130.  
  131.  
  132. Function: ENTRYBITS$
  133. --------------------
  134. Syntax: n$=ENTRYBITS$
  135.  
  136. This function returns a string containing the protection-bits status of
  137. the current file or directory.  An example may be "----RWED"  the same
  138. format as given by the AmigaDOS "LIST" command.  Possible bit settings
  139. are HSARWED:  H=HIDDEN, S=SCRIPT, A=ARCHIVED, R=READABLE, W=WRITEABLE,
  140. E=EXECUTEABLE, D=DELETEABLE.
  141. Any bits that are not set will have the "-" character in their place.
  142.  
  143.  
  144. Function: ENTRYSIZE
  145. -------------------
  146. Syntax: n.l=ENTRYSIZE
  147.  
  148. This function returns the size in bytes of the current directory entry.
  149. Note that sub-directories return a size of zero whether they are empty
  150. or not.
  151.  
  152.  
  153. Function: ENTRYDATE
  154. -------------------
  155. Syntax: d$=DATE$(ENTRYDATE)
  156.  
  157. This function returns the date the current entry was last modified, in
  158. the same format as SYSTEMDATE uses.  (The number of days since 1/1/1978)
  159. Thus, you may use the DATE$ and DATEFORMAT commands to translate it into
  160. a string with a more human-readable string.
  161.  
  162.  
  163. Function: ENTRYHOUR, ENTRYMINS, ENTRYSECS
  164. -------------------
  165. Syntax: h=ENTRYHOUR:m=ENTRYMINS:s=ENTRYSECS
  166.  
  167. ENTRYHOUR:
  168. This function is related to ENTRYDATE, above, but returns the hour of the
  169. day (0-23) at which the entry was last modified.
  170.  
  171. ENTRYMINS:
  172. Returns the minute (0-59) of the time at which the entry was modified.
  173.  
  174. ENTRYSECS:
  175. Returns the second (0-59) of the time at which the entry was modified.
  176.  
  177.  
  178.  
  179. Function: ENTRYCOMMENT$
  180. -----------------------
  181. Syntax: c$=ENTRYCOMMENT$
  182.  
  183. This function will return the string containing the filenote for the
  184. current directory entry, or "" if there is none.
  185.  
  186.  
  187.  
  188. *********************
  189. * DIRECTORY EXAMPLE *
  190. *********************
  191.  
  192. This example will list the entries in RAM: in a format very similar
  193. to the AmigaDOS "LIST" command.  Note that you need to "ChDir" to
  194. a directory in order to read it from the first entry again.
  195.  
  196.  
  197. ChDir "RAM:"
  198.  
  199. While MoreEntries
  200.   Print LSet$(EntryName$,30)
  201.   If EntryDIR then Print "Dir   " Else Print LSet$(Str$(EntrySize),6)
  202.   Print EntryBits$," ",Date$(EntryDate)," "
  203.   Print EntryHour,":",Right$("0"+Str$(EntryMins),2),":"
  204.   NPrint Right$("0"+Str$(EntrySecs),2)
  205. Wend
  206.  
  207. MouseWait
  208.  
  209.  
  210.  
  211.  
  212. Command: ANALYZEDISK
  213. --------------------
  214. Syntax: ANALYZEDISK "DRIVE:"  -or-  If ANALYZEDISK "DRIVE:" Then...
  215.  
  216. This command returns FALSE if the specified device or pathname was not
  217. valid.  If successful, details about the specified drive can be read with
  218. the following "DISK" functions.  The values for these functions will not
  219. change until ANALYZEDISK is executed again, either on the same drive or
  220. another one.
  221. Note:  If given a full pathname, such as "DF0:System/Utilities" this
  222. command will still know enough to analyze the disk "DF0:"
  223.  
  224.  
  225. Function: DISKUNIT
  226. ------------------
  227. Syntax: n=DISKUNIT
  228.  
  229. This function will return the unit number of the most recently analyzed
  230. disk.  DF0: for example, would return zero, while DF1: would return 1.
  231.  
  232.  
  233. Function: DISKERRS
  234. ------------------
  235. Syntax: n=DISKERRS
  236.  
  237. This function will return the number of soft errors DOS knows about on
  238. the last analyzed disk.  This should normally be zero.
  239.  
  240.  
  241.  
  242. Function: DISKCAPACITY
  243. ----------------------
  244. Syntax: n=DISKCAPACITY
  245.  
  246. This function returns the capacity in bytes of the last analyzed drive.
  247. For example, a fastfilesystem-formatted disk's max capacity is 837K, so
  248. DISKCAPACITY would return 857904, which divided by 1024 is 837.
  249.  
  250.  
  251.  
  252. Function: DISKUSED
  253. ------------------
  254. Syntax: n=DISKUSED
  255.  
  256. This function returns the number of bytes actually in-use on the last
  257. analyzed drive.
  258.  
  259.  
  260.  
  261. Function: DISKFREE
  262. ------------------
  263. Syntax: n=DISKFREE
  264.  
  265. The opposite of DISKUSED, DISKFREE returns the number of bytes free
  266. on the disk.  This function would be very useful, for example, in a
  267. program that needed to save information to disk.  You would be able
  268. to first determine if the specified SAVE disk had sufficient space.
  269.  
  270.  
  271. Function: DISKBLOCKS
  272. --------------------
  273. Syntax: n=DISKBLOCKS
  274.  
  275. This function returns the number of bytes each block on a disk uses,
  276. making it possible to convert the byte-values of the above functions
  277. to number of blocks.
  278.