Documentation Help file revision - Copying hidden DESCRIPT.ION files


Jul 6, 2008
Since the only way to copy a descript.ion file is to remove the hidden attribute I think the help for COPY needs a revision.

The following can be found below the /Z explanation of the Advanced Features for COPY.

Use caution with /A:, /H, or /K when both the source and destination directories contain file descriptions. If the source file specification matches the description file name (normally DESCRIPT.ION), and you use a switch which tells COPY to process hidden files,
the DESCRIPT.ION file itself will be copied, overwriting any existing file descriptions in the destination directory. For example, if the \DATA directory contains file descriptions this command would overwrite any existing descriptions in the \SAVE directory:

[c:\data] copy /h d* \save\

I would recommend this whole caution be deleted since /A: /H /K do not allow copy to work on a hidden DESCRIPT.ION file.
Sorry, you are wrong. I just tested that when copying or moving hidden files is enabled it is possible for the hidden file DESCRIPT.ION from the source directory to replace the DESCRIPT.ION file in the destination directory. I had difficulty testing because my COPY and DIR commands are already aliased to include the safety option /[!descript.ion].
You don't even need the /H; it's implied by /A:. (And /K is irrelevant; it just tells COPY to duplicate the read-only attribute on the destination file.)

Doesn't work on my system. See below.

Thu Apr 4, 2013 10:47:07

Volume in drive C is OS Serial number is aec2:b70c
Directory of C:\testdir1\*

4/04/2013 10:47 <DIR> .
4/04/2013 10:47 <DIR> ..
0 bytes in 0 files and 2 dirs
615,737,200,640 bytes free

Thu Apr 4, 2013 10:47:16
C:\testdir1>*copy /a: c:\jpsoft\tcmd13\descript.ion
0 files copied

Thu Apr 4, 2013 10:48:41
C:\testdir1>*copy /h /a: c:\jpsoft\tcmd13\descript.ion
0 files copied

Thu Apr 4, 2013 10:48:51
C:\testdir1>*copy /z /h /a: c:\jpsoft\tcmd13\descript.ion
0 files copied

The /h does work with other hidden files just not with a hidden descript.ion.

from Steve Fabian:
"I just tested that when copying or moving hidden files is enabled ...."

How do I enable copying or moving hidden files, specifically descript.ion?

Where is this setting documented? I haven't been able to find it.
Just a thought... are you sure the "c:\jpsoft\tcmd13\descript.ion" file exists?
This has bothered me for quite some time. I get the same result as rps ("0 files copied") and, like rps, I would very much like to know how to overcome this, so that I am able to copy descript.ion files (in my case, .description files). Can anyone help?
The reason description files (by default: DESCRIPT.ION) are treated specially is that their content should match the files currently in a directory. To maintain synchronism of files and descriptions in each directory, by default, when a file is moved, its description is also moved from source directory to the target directory; when a file is copied, its description is also copied; the /Nn option will prevent that..

If you copy a description file to a directory which already had a description file the descriptions of files may be lost, and files not in the directory may have entries in the description file. For this reason if you move files with a TCC command it is unnecessary to do anything with the description file. Only unusual operations benefit from explicit handling of the description file.

BTW, I repeated the tests I reported above, and I found that in the latest build of TCC15 the COPY command behaves differently: a description file can be copied only if you first remove its default H(idden) attribute, regardless of the status of the SETDOS /D option. This is indeed a deviation from the documented operation of COPY.
Steve, thanks for the reply. I understand and appreciate the reasons behind the special handling. Nevertheless, there are times when it is necessary to copy the descript.ion file, and we should not be prevented from doing so (shades of MS). I'm using TCC 13.04.63 x64, and SETDOS /D does not resolve the issue. There should be a simply command-line switch for the copy command to allow this. Short of that, does anyone have any other work-around?
Short of that, does anyone have any other work-around?
In my - admittedly rudimentary - tests removing the hidden attribute allowed the description file to be copied. You could create a simple alias to 1/ unhide the source description file, 2/ copy it to the target directory, and 3/ hide the description files in both the source and target directories. Another possibility (UNTESTED!!!) is to use the SETDOS /D option to temporarily change the name of the description files (to some filename you never use) before copying, and restore it when done.
Hi Steve, I often need to copy or re-create a directory tree--and I have descriptions for the directories! Assume the destination directory tree exists, but is empty. I wish to copy just the description for the directories (i.e. copy the descript.ion files), which seems to require removing/replacing the hidden attribute, but I'm not sure how to write an alias to do that, since the destination changes for each directory in the tree.

As for changing the name of description files, then copying the former-named files (descript.ion), then changing the name back, I would like to know if anyone has tested this and found it safe?
One of the things you can do is to copy each directory description, thus (untested!!!):
    describe target_dir /d"%@descript[source_dir]"
This can be done at the same time as creating the target directory.

These commands make all DESCRIPT.ION files of a directory tree copied (untested!!!):
attrib /s /a:h -h source_dir\DESCRIPT.ION
copy /s source_dir\DESCRIPT.ION target_dir\
attrib /s /a:-h +h source_dir\DESCRIPT.ION target_dir\DESCRIPT.ION

The method where first you use SETDOS/D to change the name used by TCC to find description files, copy everything include hidden files named DESCRIPT.ION, and restore the name by a second SETDOS/D worked in my quick test. Te only thing that could have made it fail would have been if changing the search name would have also renamed existing description files, but that does not happen.

You have three distinctly different methods above to accomplish your goal.
The method where first you use SETDOS/D to change the name used by TCC to find description files, copy everything include hidden files named DESCRIPT.ION, and restore the name by a second SETDOS/D worked in my quick test.

Note that it's possible to change the description-file name to something illegal:

set olddname=%_dname
setdos /d"nul.txt"
copy ...

NUL.TXT or the like is guaranteed not to match any real filenames, and TCC doesn't complain about this bit of chicanery.
I don't use the descriptions so I'm in unfamiliar territory here. But couldn't you append the source DESCRIPT.ION to the destination DESCRIPT.ION file then do DESCRIBE /U to clean it up?
Your approach would work nicely in general (except for files or directories with different descriptions in the original and appended description files), but my understanding of the original post and its follow ups is that the destination is a new directory tree with no files, which is NOT created by TCC's COPY command. Were it created by TCC's COPY, the directory descriptions would be automatically duplicated, and no copying of descriptions or description files would be needed. This was just tested in the current TCC build.
Thanks to all you experts for your insight. I would really like to use the "change the name" method.

Well, this is interesting: TCC 13 x64 running on Windows 7 Pro 64-bit SP1; each time I try setdos /d"test.txt", Windows tells me "The program has stopped responding" and I must close it. I've never tried using setdos to change the description file name before (I have it set in tcmd.ini to ".description"). Any thoughts on why this is happening?
I just tested it with the latest TCC, 15.01.52, both 32b and 64b, same Win7, and no such issue found.Only 32b version of V13.04.63 installed on Win7, it worked faultlessly. Also tested 32b version of V13 and V15 on WinXP Professional SP3, successfully. I tried the name change both with descriptions enabled and disabled, always worked. Try "which /a setdos" to verify it is the internal command, not an alias or plug-in (or some other program). Another possibility I can think of is one of file permissions to "test.txt", but not a likely candidate - the command only changes a data field inside TCC, without actual file access. Lastly, the name you use, .description, may have properties / permissions preventing the change. Using only 32b TCC15 on Win7/64b I was able to change the name to .description and back to descript.ion. You should try to modify your .INI file using a different name, and try changing the name to various values. If all else fails, you may need to reinstall TCC13.
Steve, thanks for all your testing! It is the correct setdos command. One other factor (though I doubt it is a contributor): I had several TCC windows open at the time.

In the interim, I used your attrib /s method to copy the descriptions across from one directory tree to another, and then hide them, and it worked fine. Thanks!

In earlier versions, there was no difficulty in copying the description file. I really do think that there should be a command line switch (or setdos option) to allow this!

Similar threads