[Wish] Unlimited length of comment in descript.ion file

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
sas2000
Power Member
Power Member
Posts: 682
Joined: 2003-02-07, 04:32 UTC
Location: Galiza

Post by *sas2000 »

 
Support ++
 
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

ghisler(Author) wrote:descript.ion isn't a format with which you can do what you want! It was introduced by the makers of the tool 4dos and 4nt. These tools limit the length of the descript.ion line to 512 characters, and do not support any line breaks...
Wise spoken words ...
Due to the fact, that TC just "uses" this standard, you should not modify or enhance it !

Beside of getting incompatible, it is at least nasty.
Imagine a 4dos or 4nt user (or an application that relies on the standard) will crash if it reads such an incompatible descript.ion file ...
TC gets banned and flamed.

Even Microsoft had a major drawback as they used, enhanced and finally modified the Java VM of Sun. They had a lot of troubles, resulting in a lost of usage permission by law.

If you really need a description of more than 512 char., simply use a text file with the same name.
#5767 Personal license
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

What are you talking about, sqa_wizard? The Ctrl-D char is PART of the descript.ion definition!
The characters
after the description allow extension of the description format
for use by other programs
. They are as follows:

* is an ASCII Ctrl-D (04), and marks the end of the description
text and the beginning of information for a program other than
4NT or Take Command
. This symbol can appear multiple times on each
line; each occurrence marks the beginning of information for another
program.

[...]

The line length limit is 4096 bytes; exceeding this limit will cause
unpredictable results.
http://jpsoft.com/ascii/descfile.txt

So, it is completely ok to use descript.ion files longer than 511 bytes up to 4096 bytes and it is also ok to interpret a \n as a line break.

And, there even is another point in the descript.ion standard:
<ID> is an identification byte for the program which is using this
area of the particular line. If you are writing a program which
will store information in DESCRIPT.ION, test it using an ID byte of
your own choosing. When you are ready to release the program,
contact JP Software and we will provide you with an ID byte value
that is not in use by others to the best of our knowledge.
Own choosing, right? Well...

Icfu
This account is for sale
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Thank you icfu for the detailed info on this.

Sorry, if my words are not clear enough.
I'm not against using the standard according the specification.

Your proposals are within the specification for sure.

I want to point out the danger of breaking it only.
#5767 Personal license
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

gbo wrote:Support it also, and if it will be possible to comment several files in one operation it would be great (I know there is a Powerpro script alternative).
You're right, there is.
Single user license #329241
PowerPro scripts for Total Commander
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

I know, this thread is about enhancement of TC's build-in comment edit functions. Nevertheless, I've made my own comment editor for TC.
If you like to try it, you can get it here:

TCEditCommentExtended_0.1.0.zip (267 KiB)


Two screenshots:
First one
second one


Excerpt from Readme_EN.txt:

=======
Purpose
=======
TCEditCommentExtended is an alternative editor for descript.ion comments for the filemanager TotalCommander.

========
Features
========
* Multi-line comments: Line breaks in comments are allowed. The substition string for these line breaks is customizable.
* Comments with more than 512 characters (TC's limit) and even with more than 4096 chars (descript.ion standard) are allowed.
* Copys descript.ion comments from one file to another.
* Edits comments for multiple files.
* Supports file IDs: Application specific information can be edited too.
* Imports the output from an arbitrary command. Output can be read from stdout, from clipboard and from file.
This allows to get values from TC content plugins, using the command line tool "CopyInfo2Clip" from wdxInfoPacker packer plugin.
Use patterns "[Istdout]", "[Iclip]" and "[Ifile={filename}]" as placeholders for the command output.
Some TC-like variables in editbox and command are supported (%N, %n, %P, %p, %O, %E, %L, %l)
* Numbers your files (file pattern "[C]")
* Comments can be edited by search & replace. Regular expressions are supported.
* descript.ion files can be "cleaned up" (lines for not existing files will be deleted)
* Font in the editbox is customizable (if you prefer monospaced fonts for comments, e.g.).

========================================
Missing features /Drawbacks / Known bugs
========================================
* It's V0.1.0, so it may have bugs. Use TCEditCommentExtended at your own risk!
* It's slow.
* Only descript.ion-format is supported (files.bbs-format isn't)
* Codepage /character encoding can't be selected (option for "DOS (OEM)" charset is not available, e.g.)
* Handling of double quotes needs to be improved:
- Leading and trailing quotes in INI-values are cut, when value is read from INI-file
- Handling of quotes in commands, which are called via "%ComSpec% /C {command}",
differs from handling of commands, which are excuted in a DOS-box.
Try to use short names (%n, %p, %l) instead of long names, if you encounter any problems.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Impressive script, but you have forgotten to insert a Ctrl-D char at byte number 512! The antique limitation of descript.ion is 511 bytes of user data plus control char, not 512!
20.09.02 Fixed: When changing descript.ion file, don't show data after Ctrl+D character to the user
[...]
17.09.02 Fixed: Changed maximum allowed comment length for descript.ion lines to 511
It is important to know that TC does not only "not show" content after a Ctrl-D at position 512, but that it also nukes that content when saving in the TC comment editor without a *peep* warning!
If a comment is smaller than 511 bytes and has a Ctrl-D char somewhere, TC just shifts the content right when editing and cuts at position 511 when saving.

Not very friendly actually! :evil:

I expected at least that TC would include every comment data after a Ctrl-D char when copying, and that it would not overwrite that data when editing.

I mean, isn't that the obvious intention from the descript.ion standard? Ctrl-D = Don't destroy that data but feel free to support it?

Icfu
This account is for sale
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

Thanks for trying the script, Icfu!

Do you know, wether the limitation to 511 bytes user data is specific for TC or wether it is an obsolete general standard of descript.ion file format? I didn't found something concerning this (511 bytes limit) yet.

Due to the TC's limitation to 511 bytes user data it wouldn't help to insert a Ctrl+D at position 512, or do I miss something? Once saved with TC, the comment is mutilated (everything after position 511 is lost, as you already mentioned).

Albeit this, an update to version 0.2.0 is almost ready. The update will fix a bug concerning the "Get comment from target file" function. And it splits the general comment: With V0.2.0, the first 511 bytes of the comment will be written to the general description area. If the description is >511 bytes, then additionally the full comment will be written to an area with the TCEditCommentExtended-specific file ID 0x7C (of course this is not officially registered ;) ). To keep redundant data as small as possible, I test an alternative, which stores only a MD5 checksum for the first 511 bytes to the 0x7C-area (unfortunately, this needs an external tool, md5deep e.g.). On start, V0.2.0 checks the current general description against the comment stored in the 0x7C-area. If equal, then the full description is displayed. If not equal, then the comment must have been modified externally and only the general comment is displayed (and the obsolete full description will be deleted).
I mean, isn't that the obvious intention from the descript.ion standard? Ctrl-D = Don't destroy that data but feel free to support it?
Absolutely!
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Do you know, wether the limitation to 511 bytes user data is specific for TC or wether it is an obsolete general standard of descript.ion file format? I didn't found something concerning this (511 bytes limit) yet.
I have mentioned the link to the descript.ion standard above, you have seen it I think:
http://ghisler.ch/board/viewtopic.php?p=97394#97394

Otherwise, the limit of 511 bytes is due to original 4NT and Take Command limitations:
http://www.jpsoft.com/help/describe.htm
Due to the TC's limitation to 511 bytes user data it wouldn't help to insert a Ctrl+D at position 512, or do I miss something? Once saved with TC, the comment is mutilated (everything after position 511 is lost, as you already mentioned).
Indeed, it doesn't help with TC, only with programs which adhere to the standard. ;)

Good luck with the new version, but make sure that you have more fun than work! :)

Icfu
This account is for sale
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC does adhere to the standard! Ctrl+D is NOT needed, ONLY if there is some additional data behind the text comment! TC does copy such data with the comment when you copy the file.
Author of Total Commander
https://www.ghisler.com
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

TC does adhere to the standard!
It does NOT because you are cutting the comment behind byte 511 when saving, this is not ok.
DESCRIPT.ION standard wrote:4NT and Take Command will copy, delete, or move all the information on a line in DESCRIPT.ION, including information owned by other programs, when performing the same action on the corresponding file. They will also change the name if a file is renamed. To support DESCRIPT.ION properly, your program must do the same if it copies, deletes, moves, or renames files. Take care not to remove information which does not belong to your program, or delete lines which contain information for other programs. Your program should be able to handle a line terminated by a CR or LF alone, a CR/LF pair, an EOF (ASCII 26), or the physical end of the file. The lines it creates should be terminated with CR / LF. The line length limit is 4096 bytes; exceeding this limit will cause unpredictable results.
I hope that you will properly support descript.ion standard some day, with full 4096 bytes support, line breaks, etc...

Everything is possible, it's up to you. :)

Icfu
This account is for sale
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

I've just uploaded V0.2.0 of TCEditCommentExtended:

TCEditCommentExtended_0.2.0.zip (478 KiB)

Updated screenshots:
First one
Second one


Changes from 0.1.0 to 0.2.0

* Fixed: Small bug in function "Get comment from target file"

* Changed: General description is splitted, when longer than 511 characters. The "extended" comment (chars from 512 up to the end) is stored in the area for file ID '0xDE' (DE="Description Extension"). Don't care for this, it's managed internally. When comment is loaded into TCEditCommentExtended, then the general description and the description extension will be joined together again.

* Added: Some "extended" file properties now can be inserted without the need of an external tool (e.g. image dimension, duration of an audio track, NTFS-/OLE-comment and some more).


"Bonus"

The download package contains a stupid tool called "ArcInfo". That's the reason, why the zip-file is so big (478 KiB). With "ArcInfo" you can generate summary information for archives, like
* compression ratio,
* size unpacked and
* number of files in the archive.
The output format is customizable (see "ArcInfo.ini").

"ArcInfo" parses file lists, which are generated by the external commandline tools for 7Zip, UHArc and SBC. At least one of these packers (including commandline versions) should be installed on your system:
* UHarc.exe for scanning uha-archives,
* SBC.exe for scanning sbc-archives and / or
* 7z.exe for all types of archives, which are supported by 7Zip.

The result string is copied to the clipboard. It can be read from clipboard and inserted into a descript.ion comment with TCEditCommentExtended using the pattern "[Iclip]".

A content plugin like "TotalSQX.wdx" for sqx-archives would be much better, of course; "ArcInfo" is just a workaround...
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Great! Nothing more to say!

You have saved the future of the descript.ion format with that script, that's for sure. :)

Icfu
This account is for sale
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

Thank you van Dusen very good application, everything is working fine except when I try to use the multiple files feature it doesn't work. Am I missing something ? :(
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

Hi gbo,

what exactly happens (not)?

* Did you run an external app (checkbox "Run" and command inputbox)?
If so, please check the command (path and filename of the called application etc.), given in the command inputbox.
And do not forget to insert a placeholder "[Istdout]" or "[Iclip]" or "[Ifile={filename}]" in the comment editbox. These placeholders will be replaced by the output of the command. When no placeholder is found, then the command is executed for each selected file, but it's result isn't applied to the comments.

* If you ran "ArcInfo.exe" as external program, check the paths to 7z.exe etc in your ArcInfo.ini too, please.

* Did you run a command, which should be called as command line (DOS) command? If so, don't forget to check the "DOS" checkbox.

* If you run an external "DOS"-command, there can be troubles with quotes. Did you use quotes in your command? Can you give an example, please?

* Did you push the "Set" button before saving (sorry for asking this)? The configured comment (comment pattern) for multiple files will be applied, when the "Set"-Button is pressed.

* Did you check the state of the "Set comment for" radio buttons? Perhaps "files without comments" is checked, but all selected files already have a comment (so no file is qualified)?

* What OS are you running? I've tested the script only on WinXP HE SP2 yet :-(

* Did you run the compiled version (TCEditCommentExtended.exe) or the interpreted version (TCEditCommentExtended.au3)? Strange to say, the *.au3 behaves different from the *.exe. I recommend to use the *.exe. If you ran the *.au3, which version of AutoIt do you have installed? I am using V3.2.0.1 at the moment.


Thank you! :-)
Post Reply