home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / FA41.ZIP / FILEATTR.DOC < prev    next >
Encoding:
Text File  |  1988-04-26  |  5.4 KB  |  117 lines

  1.                              FILE ATTRIBUTE UTILITY
  2.                                  Version 4.1
  3.                                 April 26, 1988
  4.  
  5.                                by Steven Trace
  6.  
  7.                             CompuServe 70317,2124
  8.                                 OPUS Net 157/1
  9.  
  10.  
  11. FA allows you to view and manipulate  your  file  attributes.  Like  DOS's  3.x
  12. ATTRIB  program  you  can  set  files to be Read Only which prevents accidental
  13. erasure however it also allows you to mark or unmark a file as  Hidden,  System
  14. or Archive as well.
  15.  
  16. FA  is very similar to Norton's Utility FA and even more like Charles Petzold's
  17. ATTR published in the June 10,  1986  PC  Magazine.  In  fact  the  syntax  and
  18. capabilities  are  similar to  ATTR.  The main reason for my writing of this
  19. utility is that I failed to get ATTR to run even after checking my input of the
  20. published Assembly Program 5 times.  FA was written in Turbo Pascal so is  much
  21. larger  than  the  625  bytes  of  the ATTR and runs a bit slower but IT WORKS!
  22. However thanks to Charles' excellent article I was able to create this  program
  23. and  make sub-directories  disappear.  Hidden  programs but not system programs
  24. may be run from the DOS prompt with DOS 3.x but not 2.x.  A  utility program is
  25. included to run hidden programs under DOS 2.x.
  26.  
  27. Possible Uses:
  28.  
  29.    Read-Only
  30.  
  31.    The use of this parameter allows you to protect files from being deleted,
  32.    or  written  over.  However  you  can always reverse your setting of this
  33.    attribute so you can update a file  or  install  a  newer  version  of  a
  34.    program.  Excellent  for preventing erasure of program files or important
  35.    data files.  The major problem is you must remove the Read-Only  or  copy
  36.    file under another name to update data files.
  37.  
  38.    Archive
  39.  
  40.    All  files are set as Archive when newly created or updated.  This allows
  41.    DOS's BACKUP command with the /M switch to backup  only  new  or  updated
  42.    files.  On  occasion  you may have no need to backup newly created files.
  43.    Simply turn off this attribute for selected files  prior  to  backing  up
  44.    your hard disk.
  45.  
  46.    Hidden
  47.  
  48.    This  parameter  if set (+) will hide your files from searches using DIR,
  49.    COPY,  DEL ect.  Handy for hiding sub-directories and still allows you to
  50.    change into them using DOS's CD command.  I've include another program EX
  51.    that allows you to execute hidden programs under DOS 2.x.  Hidden but not
  52.    system program files may be executed  as usual under DOS 3.x.  EX  syntax
  53.    is as follows:
  54.  
  55.       A>EX 123.COM
  56.  
  57.    Note  that  the  extension  must  be included for the program to execute.
  58.    Also you may not pass parameters with your program. (ie, A>EX FA.EXE *.*)
  59.    Under DOS 2.x EX.EXE may not be hidden.
  60.  
  61.    System
  62.  
  63.    Basically the same as Hidden.
  64.  
  65. Syntax
  66.  
  67.    [d:][path\]FA [options] [d:][path\]filespec [options] [>filename or device]
  68.  
  69.    options:
  70.       /P : Output pauses
  71.       +  : Turns Attribute On
  72.       -  : Turns Attribute Off
  73.  
  74.       +A or -A : Archive Attribute Switched
  75.       +H or -H : Hidden Attribute Switched
  76.       +S or -S : System Attribute Switched
  77.       +R or -R : Read-Only Attribute Switched
  78.  
  79.    If  entered without any parameters you will receive a syntax error message
  80.    and the proper syntax.  The filespec is required and it  may  contain
  81.    wildcards * and ?.  If issued without any switching Parameters (ie, -A +H)
  82.    you  merely  receive a listing of all files,  including hidden and system,
  83.    with their current attribute settings.
  84.  
  85.  
  86.    Version 1 would give an error using DOS 3.x as CHMOD gave a return code
  87.    identical to the file's attribute value.  This caused an abort whenever
  88.    a file was marked as hidden only or system only.  Version 2 corrects this
  89.    by ignoring the error return code.  While this seems drastic, the only
  90.    valid codes under 2.x were file not found or path not found.  These errors
  91.    are handled when the directory search is made, so why duplicate?
  92.  
  93.    Version 2 is unmodified in version 2a.  The only change is the documentation
  94.    which indicates hidden but not system program files may be executed as
  95.    usual under DOS 3.x.
  96.  
  97.    Version 4 is an upgrade to Turbo Pascal 4.0, has an improved path message
  98.    and improved error messages.  As a result of using 4.0 the executable and
  99.    source file sizes have been reduced.  Even though FA.EXE is smaller than
  100.    FA.COM under Turbo Pascal 3.0, use of the original source run against the
  101.    Turbo Pascal 4.0 utility UPGRADE.EXE produced an even smaller file.  The
  102.    only reason I can determine is that my own FindFirst, FindNext and CHMOD
  103.    functions and procedures generate tighter code than Borland's FindFirst,
  104.    FindNext and SetFAttr.  Hard to believe since I only used the msDos(regs)
  105.    routine and not assembly language.
  106.  
  107.    Version 4.0a upgrades the response for "Press any key".  Version 4.0
  108.    required <Enter> to be pressed and would output any other character
  109.    pressed on keyboard.
  110.  
  111.    Version 4.1 requires use of the /p parameter to cause screen output to
  112.    pause.  This parameter should not be used if output is redirected to a
  113.    file or device.  I /p is used with redirection the machine will hang until
  114.    the key is pressed a suffcient number of times to clear the number of
  115.    screens that would have appeared.  Files and directories that have had
  116.    their attribute changed will appear with an '*' prior to the file name.
  117.    File date and times were added to output.