Software:ATTRIB

From HandWiki
attrib
ReactOS-0.4.13 attrib command 667x434.png
The ReactOS attrib command
Developer(s)Intel, IBM, Microsoft, DR, Datalight, Novell, Phil Brutsche, ReactOS Contributors
Initial release1984, 39–40 years ago (DOS version)
Operating systemISIS-II, PC DOS, MS-DOS, MSX-DOS, SISNE plus, OS/2, eComStation, ArcaOS, Windows, DR DOS, ROM-DOS, FreeDOS, ReactOS, SymbOS
PlatformCross-platform
TypeCommand
LicenseFreeDOS, ReactOS: GPLv2

In computing, ATTRIB is a command in Intel ISIS-II,[1] DOS, IBM OS/2,[2] Microsoft Windows[3] and ReactOS[4] that allows the user to change various characteristics, or "attributes" of a computer file or directory. The command is also available in the EFI shell.[5]

History

Several operating systems provided a set of modifiable file characteristics that could be accessed and changed through a low-level system call. For example, as of release MS-DOS 4.0, the first six bits of the file attribute byte indicated whether or not a file was read-only (as opposed to writeable), hidden, a system file, a volume label, a subdirectory, or if the file had been "archived" (with the bit being set if the file had changed since the last use of the BACKUP command).[6] However, initial releases of the operating system did not provide user-level method for reading or changing these values.[7]

The initial version of the ATTRIB command for DOS was first included in version 3.0 of PC DOS, with functionality limited to changing the read-only attribute.[7] Subsequent versions allowed the read-only, hidden, system and archive bits to be set.[8] MS-DOS version 3.3 added the capability of recursive searching through subdirectories to display attributes of specified files.[9]

Digital Research DR DOS 6.0[10] and Datalight ROM-DOS[11] also include an implementation of the ATTRIB command.

The FreeDOS version was developed by Phil Brutsche and is licensed under the GPLv2.[12]

Uses

Setting the read-only bit of a file provided only partial protection against inadvertent deletion: while commands such as del and erase would respect the attribute, other commands such as DELTREE did not.[13] Changing the system attribute was not possible in early versions of Windows, thus requiring use of ATTRIB.[13] Similarly, a system crash in early versions of Windows could lead to a situation where a temporary file had the read-only bit set and was additionally (and irrevocably) locked by the Windows OS; in this instance, booting into DOS (thus avoiding the Windows lock) and unsetting the read-only attribute with ATTRIB was the recommended way of deleting the file.[14] Manipulating the archive bit allowed users to control which files were backed up using the BACKUP command.[7]

See also

References

  1. ISIS II Users Guide
  2. "JaTomes Help - OS/2 Commands". http://www.jatomes.com/Help/Os2Cmd.php#ATTRIB. 
  3. Microsoft TechNet Attrib article
  4. reactos/attrib.c at master · reactos/reactos · GitHub
  5. "EFI Shells and Scripting". Intel. http://software.intel.com/en-us/articles/efi-shells-and-scripting/. 
  6. IBM Disk Operating System Version 4.00 Technical Reference (1st ed.). July 1988. p. 3:5. https://archive.org/details/bitsavers_ibmpcdos15lReferenceJul88_10507385. 
  7. 7.0 7.1 7.2 Petzold, Charles (June 10, 1986). "Changing DOS File Attributes". PC Magazine: pp. 249–262. https://books.google.com/books?id=pDGnxFyejN4C&pg=PA249. 
  8. "DOS Attrib". Encyclopedia. PC Magazine. https://www.pcmag.com/encyclopedia_term/0%2C2542%2Ct%3DDOS+Attrib%26i%3D41730%2C00.asp. Retrieved 2007-08-02. 
  9. "Using ATTRIB, CHKDSK, or DIR Command to Locate Files". Microsoft. http://support.microsoft.com/kb/89727. 
  10. "DR DOS 6.0 User Guide Optimisation and Configuration Tips". https://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf. 
  11. "Datalight ROM-DOS User's Guide". https://www.datalight.com/assets/files/ROM-DOS_Users_Guide.pdf. 
  12. "FreeDOS 1.2 Updates Package - attrib (FreeDOS Base)". Ibiblio.org. 2003-07-01. http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/attrib.html. Retrieved 2022-09-08. 
  13. 13.0 13.1 O'Reilly, Tim; Mott, Troy; Glenn, Walter J. (1999). Windows 98 in a Nutshell: A Desktop Quick Reference. O'Reilly. pp. 303–306. ISBN 1-56592-486-X. https://archive.org/details/windows98innutsh00orei. 
  14. Jones, James G.; Landes, Craig (2003). A+ Exam Cram 2: Windows 2000 Directory Services Infrastructure. Que. pp. 309–310. ISBN 0-7897-2867-2. https://books.google.com/books?id=WtE9GN1hhvAC&pg=PA309. 

Further reading

External links