home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / disktool / vbio / readme.txt next >
Text File  |  1994-08-22  |  7KB  |  174 lines

  1. VBIO     Visual Basic VBX for determining and setting Disk and File
  2.          information.
  3.  
  4. COPYRIGHT NOTICE / DISCLAIMER
  5.  
  6. This control is copyrighted by A. Broeze, vbx_dev@shear.iaf.nl
  7.  
  8. The VBIO.VBX control library is distributed "as is" and without warranties
  9. as to performance or merchantability or any other warranties whether
  10. expressed or implied. No warranty of fitness for a particular purpose is
  11. either expressed or implied.
  12. If you decide to use this control you do it entirely on your own risk.
  13.  
  14.  
  15. DISTRIBUTION INFORMATION
  16.  
  17. This control is a simple one I've developed for my own purposes
  18. (it came in especially handy for my installation programs). Since
  19. I think it may be useful to you as well, I hereby grant you the right
  20. to use this control under two restrictions:
  21. 1. You may not charge any fees for this control if you distribute it
  22.    with your applications
  23. 2. You'll have to mention my name in the copyrights section of your
  24.    programs documentation.
  25.  
  26. CONTROL INFORMATION
  27. This control allows you to set the volume-label, get total  & free disk-
  28. space, get and set file-attributes etc.
  29.  
  30. The VBIO vbx works with a 'current drive' and a 'current file'. You
  31. can set the current drive and current file using the 'Drive' and 'File'
  32. properties.
  33.  
  34. Errors are reported in the 'Error' and 'ErrorMessage' properties.
  35.  
  36. Following is a description of all properties and how to use them.
  37.  
  38. Property            Value                       Meaning
  39.                 
  40. Action              0 = Nothing                 <do nothing>
  41.                     1 = Reread drive info       Reread all drive related
  42.                                                 properties
  43.                     2 = Reread file info        Reread all file related
  44.                                                 properties
  45.                     3 = Set volume label        Set volume label of
  46.                                                 current drive
  47.                     4 = Set file attributes     Set file attributes of
  48.                                                 current file
  49.                     5 = Set file date/time
  50.  
  51. Drive               0 - 25                      Set the 'current drive'
  52. File                String                      Set the 'current file'
  53.                                                 File may include pathname
  54.  
  55. IsCDROMDrive        Boolean (read-only)         True if current drive is a
  56.                                                 CD-ROM drive, False otherwise
  57.  
  58. IsNetworkDrive      Boolean (read-only)         True if current drive is a
  59.                                                 networked or subst drive,
  60.                                                 False otherwise
  61.  
  62. FreeDiskSpace       Long integer (read-only)    Free diskspace on current drive
  63.  
  64. TotalDiskSpace      Long integer (read-only)    Total diskspace on current drive
  65.  
  66. VolumeLabel         Strings                     Volume label of current drive
  67.                                                 To change the volumelabel,
  68.                                                 assign another string to
  69.                                                 this property and set the
  70.                                                 action property to 3.
  71.  
  72. FileSize            Long integer (read-only)    File size of current file
  73.  
  74. FileDate            String                      File-date of current file.
  75.                                                 To change it, assign another
  76.                                                 string to this property and
  77.                                                 set the action property to 5.
  78.                                                 See the ErrorMessage property
  79.                                                 for the DateFormat to use.
  80.  
  81. FileTime            String                      File-time of current file.
  82.                                                 To change it, assign another
  83.                                                 string to this property and
  84.                                                 set the action property to 5.
  85.                                                 See the ErrorMessage property
  86.                                                 for the TimeFormat to use.
  87.  
  88. Archive             Boolean                     File-attributes of the
  89. ReadOnly            Boolean                     current file. To change the
  90. Hidden              Boolean                     file-attributes of the current
  91. System              Boolean                     file, change one or more of
  92. SubDir              Boolean (read-only)         these properties and set the
  93.                                                 Action property to 4.
  94.  
  95. Error               Integer (0-10)              Reports the last error.
  96.                                                 Check the ErrorMessage
  97.                                                 property for a textual
  98.                                                 explanation of the error.
  99.  
  100. ErrorMessage        String
  101.  
  102. The following table lists the possible values for the Error and    ErrorMessage
  103. properties:
  104.  
  105. Error             ErrorMessage
  106.  
  107. 0                 No errors encountered
  108. 1                 Drive not ready
  109. 2                 Drive does not exist
  110. 3                 File does not exist
  111. 4                 Cannot set volume label of network or cd-rom drive
  112. 5                 Error setting volume label
  113. 6                 Error setting file-attributes
  114. 7                 Unable to open file
  115. 8                 Error setting file date/time
  116. 9                 Invalid date format (must be mm/dd/yy)
  117. 10                Invalid time format (must be hh:mm:ss)
  118.  
  119.  
  120. EXPORTED FUNCTIONS
  121.  
  122. The functionality of this VBX is also available via exported functions.
  123. Below is a list of exported functions that can be called from within
  124. any langauge:
  125.  
  126.  
  127. BOOL FAR PASCAL _export IsCDROMDrive(WORD wDrive);
  128.  
  129. returns TRUE is 'wDrive' is a cd-rom drive
  130. wDrive = 0 - 25 (drive A: = 0, B: = 1 etc)
  131.  
  132. BOOL FAR PASCAL _export IsNetworkDrive(WORD wDrive);
  133.  
  134. returns TRUE if 'wDrive' is a network drive
  135. wDrive = 0 - 25 (drive A: = 0, B: = 1 etc)
  136.  
  137. LONG FAR PASCAL _export DiskFree(WORD wDrive);
  138.  
  139. reports free diskspace on drive 'wDrive'
  140. wDrive = 0 - 25 (drive A: = 0, B: = 1 etc)
  141. returns -1 on error
  142.  
  143. LONG FAR PASCAL _export DiskSize(WORD wDrive);
  144.  
  145. reports total diskspace on drive 'wDrive'
  146. wDrive = 0 - 25 (drive A: = 0, B: = 1 etc)
  147. returns -1 on error
  148.  
  149. int FAR PASCAL _export GetFileAttributes(LPSTR szFileName);
  150.  
  151. returns the file-attributes of the file pointed to by 'szFileName'
  152. returns -1 on error.
  153.  
  154. int FAR PASCAL _export SetFileAttributes(LPSTR szFileName, int attrib);
  155.  
  156. sets the file-attributes of the file pointed to by 'szFileName' to
  157. 'attrib'.
  158. Returns non-zero on success, zero on error.
  159.  
  160. int FAR PASCAL _export GetVolumeLabel(WORD wDrive, LPSTR szLabel);
  161.  
  162. retrieves the volume label of the drive 'wDrive' in 'szLabel'
  163. returns non-zero on success, zero on error.
  164.  
  165. int FAR PASCAL _export SetVolumeLabel(WORD wDrive, LPSTR szLabel);
  166.  
  167. sets the volume label of drive 'wDrive' to 'szLabel'
  168. returns zero on success, non-zero on error.
  169.  
  170. --------------------------------------------------------------------------
  171. Arjen Broeze
  172. vbx_dev@shear.iaf.nl
  173. 21/08/94
  174.