Handle file attributes in a structure
Windows functions provide attribute handling only within the current directory. This utility automatically dives into the file structure. It is very handy to save attributes to a file before copying the structure to a CD - where everything becomes read-only.
This utility also tries to cope with a very strange behaviour of Windows NT:
When copying a file from a W95, W98 or W2K system to a Windows NT computer, NT replaces the creation date with the date
of the copy. Even worse: If you copy a file from an NTFS partition to a FAT partition (or vice versa) of the same machine,
the same date confusion happens. Hence you get a creation date which is younger then the last modification (see all but
the first line in the example below)!
- Using AttriStruc
- Save attributes to file
- Restore attributes from file
- Set attributes
- Set modification date to creation date
- Error messages
- Get the utility
Using AttriStruc
This utility takes all input from a single dialogue:
![]() |
Enter the full path of the structure to be maintained. The structure comprises all files in the path and all files in the subdirectories. |
Select the desired function |
|
See details below | |
For function "Set attributes" set the attributes according to your needs | |
Check this box if you want to get rid of strange modification dates (works both in Restore... and Set attributes). | |
Save attributes to file
This function traverses the file structure and writes the information about the files into file _attristruc.txt
in the defined path (e.g. to E:\FM-course\_attristruc.txt
). The following is an excerpt from such a file.
This file was generated by AttriStruc - do not modify RASH Creation Modification -A-- 1992:10:22:12:00:00 1999:08:10:15:58:33 G:\Data\Filetype_examples\ansitext.txt RA-- 2001:06:18:15:07:13 1994:11:15:22:01:52 G:\Data\Filetype_examples\attributes_ra--.txt --S- 2001:06:18:15:08:11 1994:11:15:22:01:52 G:\Data\Filetype_examples\attributes_--s-.txt --SH 2001:06:18:15:08:51 1994:11:15:22:01:52 G:\Data\Filetype_examples\attributes_--sh.txt
The utility signals "work done" with this message:
Restore attributes from file
This function looks for a _attristruc.txt
in the defined path and applies the file attributes according
to the contents of the file.
You can set up a batch change of attributes by modifying the saved file. For this you must follow these rules:
- Do not change the column layout - The attributes and the dates must be in this location and format. The columnar information is separated by blanks, not TAB characters please.
- Attributes are in the order Read-only, Archive, System and Hidden).
- The upper case letters define a set attribute (
A
in second location: Archive attribute ON). A hyphen in the specific location defines an unset attribute (-
in second location: Archive attribute off). - The time is always written in the format
yyyy:mm:dd:hh:mm:ss
(4-digit-year, month, day, hour, minute, second) - Do not end or intersperse the file with empty lines (superflous NewLines).
The utility signals "work done" with this message:
Set attributes
You may set the attributes of all files in the structure with the option buttons. Using as-is does not touch the respective file attribute.
If you want to specify attributes only to certain file types, use a good text editor (such as TextPad)
to mark all lines of interest in the saved a _attristruc.txt
file and then edit the attribute column of the
marked lines. Then "Restore attributes from file".
The utility signals "work done" with this message:
Set modification date ...
You may whish to get rid of those strange dates and synchronise the modification date and creation date for copied files. With this function the modification date becomes the date of the copy operation.
You can combine this operation with the Set attributes or just leave all attributes "as is" to just 'correct' the modification date.
You can also combine this function with Restore attributes from file.
Error messages
- Directory <sourcepath> does not exist, spelling error?
The directory defined with sourcePath can not be found. - The file <
_attristruc.txt
> seems to be damaged. Re-generate it!
The first two lines of this file must be similar to what is displayed in the example above. - The file <fname> does not exist. Maybe the attribute list <
_attristruc.txt
> is damaged!
Either the file fname has been removed from the structure after_attristruc.txt
was created, or the file_attristruc.txt
has been modified incorrectly. - More than 5 files listed in <
_attristruc.txt
> do not exist any more - process terminated!
The file_attristruc.txt
seems to be completely outdated or damaged. Re-generate it.
Get the utility
The utility is written with the WinBatch system from Wilson Window Ware and then compiled. If you have more than one utility of this sort running, it may be useful to have the dll installed only once.
The attristruc.zip
(585 kb) contains the attristruc.exe
and the wbdcc34i.dll
files. Just expand the zip file into a suitable directory.