[Main topics] [Navigation]

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)!

[To top/bottom of page] Using AttriStruc

This utility takes all input from a single dialogue:

[Picture] 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).
 
 

[To top/bottom of page] 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:

Screen shot from AttiStruc: fields to enter the path and a number of option buttons to define the task. Two buttons

[To top/bottom of page] 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:

The utility signals "work done" with this message:

Message from AttiStruc

[To top/bottom of page] 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:

[Picture]

[To top/bottom of page] 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.

[To top/bottom of page] Error messages

[To top/bottom of page] 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.

 

[Main topics] [Navigation]
 URL:  Created: 2001-06-18  Updated:
© Docu+Design Daube, Zürich    
  Business of Docu + Design Daube Documentation issues Sharing information Klaus Daube's personal opinions Guests on this site Home of Docu + Design Daube To main page in this category To first page in series To previous page in series To next page in series To bottom of page To top of page Search this site Site map Mail to webmaster To bottom of page To top of page