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

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2van Dusen
Hi,

you app looks very nice. :-)

I have seen the code. This must have been hours of work. :shock:

I have to interfere a bit here. Maybe you read here which improvements can be expected in TC 7.

Don't get me wrong your add-on seems really good but I guess there will be an internal solution for similar tasks in TC quite soon. I just can't watch and keep silent how someone writes such a complex tool parallel to an internal TC solution.

If someone searches for a content plug-in idea read on:
As announced in the aboce linked thread TC 7 will have content plug-in write support. So a plug-in developer could write a plug-in which works like an improved tc.comment field.


I hope I found the right words and you understand my intention. :wink:
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It does NOT because you are cutting the comment behind byte 511 when saving, this is not ok.
My documentation says that descript.ion supports 512 bytes max.
I hope that you will properly support descript.ion standard some day, with full 4096 bytes support, line breaks, etc...
I'm not aware of these features - where can I find documentation on how this needs to be implemented to be compatible with other apps using descript.ion?
Author of Total Commander
https://www.ghisler.com
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
- where can I find documentation on how this needs to be implemented to be compatible with other apps using descript.ion?
http://www.ghisler.ch/board/viewtopic.php?p=97394#97394
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Interesting, they must have increased the allowed length at a later time. But the specs do not allow new lines within a comment if the comment line ends with <cr><lf>, right?
Author of Total Commander
https://www.ghisler.com
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 »

My interpretation of the file format description was:

A line in descript.ion (a "record") may be terminated by
* 0x0D (a single CR) or
* 0x0A (a single LF )or
* 0x0D0A (CRLF) or
* 0x26 or
* the physical end of the file

The begin of an area for other program info is indicated by 0x04 (Ctrl-D).

The description and other program info may not contain
* Ctrl-Ds,
* CRs,
* LFs,
* NULs (0x00).
Don't know why 0x26 is not listed in the specification, but since 0x26 should be interpreted as "end of line", it must be a "forbidden" character too, IMO.

In order to mark line breaks within the comment text, a character or a string must be used for substitution, which is not "forbidden" according the list above. Unfortunately all other characters may occur as user data. Thus, it would be sensible to make this substition character (or string) configurable. "\n" would be a good choice because of its common meaning. (But the current implemention causes unwanted / unexpected results, when using "\n" within the description.)

For the script "TCEditCommentExtended" I have recommended to use 0xA0 as substitution character. 0xA0 is a NBSP (non-breakable space... paradox, to misuse it as line break, isn't it? ;) ). Because NBSP is a white space, it isn't conspicuous, when the description should be displayed in a single row (comment view in the file list, for instance).
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

The begin of an area for other program info is indicated by 0x04 (Ctrl-D).
...PLUS a program specific ID:
filename.ext Description[*<ID>Other program info]...<CR><LF>
So, ghisler should contact Jpsoft and ask for a unique ID to not create descript.ions that conflict with other programs.

I had already pointed that out on the last page:
http://ghisler.ch/board/viewtopic.php?p=97394#97394

In order to not produce "unexpected" results, the interpretation of \n as a line break should be made user configurable, default off. The same is true for other widely known abbreviations like \t for a tab, etc...

Icfu
This account is for sale
urrri
Junior Member
Junior Member
Posts: 6
Joined: 2005-06-30, 05:04 UTC

Post by *urrri »

2 van Dusen

Thank you. It is really what I need and even more.
Waiting for 7 version and implementation as plugin :-)
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 »

2urrri

You are welcome :)

Some hints for / bugs found so far in V0.2.0:
  • Some virus scanners (CAT-QuickHeal, TheHacker, UNA and McAfee) claims the TCEditCommentExtended.exe to be malware. McAfee, for instance, reports "StartPage-JR" and deletes all AutoIt scripts, which were compiled with Aut2Exe version 3.2.0.1. These are seemingly false positives (see Startpage-JR virus alert, e.g.)

    Problem can be solved by
    - installing the newest virus signature files
    - compiling the *.au3 script, using a user defined icon instead of the deafult icon (yes, this does the trick... OMG!)
    - compiling the *.au3 script with an actual beta version of AutoIt.
  • Size of a descript.ion line isn't calculated correct, when the general comment is > 511 bytes ("surcharge" of 10 bytes for Ctrl+D plus file ID plus 8 bytes CRC32-checksum is missing)
  • Working directory isn't set. If you assign the script (au3 or exe) to a button or to a menu entry, then don't specify a working directory, please. Otherwise descript.ion file is always created / updated in that working dir :oops:
  • Handling of multiple descript.ion files for multiple files from different directories (when multiple files from branch view have to be commented, for instance) isn't implemented yet. Big issue, should be fixed, IMHO.
2Lefteous

Thank you! :)
Don't worry, I've made it just for (my own) fun. Just as urrri I am looking forward to TC 7 (and content plugins with support of extended functions for user defined columns... but this hint concerns the "bonus" tool ArcInfo, am I right?).
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

Hi Van Dusen,

I tried again your application and here is a video sqx format that would maybe allow you to see what I am doing wrong.

Video (sqx)

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

No

* 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?

See above

* 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.

Guess it is related to Q1 and Q2

* 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)?

No I understood that :wink:

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

XP SP1

* 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.

I run the exe file

TIA

See you soon
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

So, ghisler should contact Jpsoft and ask for a unique ID to not create descript.ions that conflict with other programs.
Is there a list of already used IDs somewhere? Perhaps there is already one encoding line breaks?
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 »

Just in case there is a misunderstanding: The ID I mentioned in your quote is used to identify the program, not line breaks!
1. 0x04
2. program specific ID

=> Two bytes that tell all other programs: Attention, this is an area I have to ignore, it's used by program X!

Anyway, maybe you are right and the line break issue is already solved and JPSoft has only forgotten to mention it in the definition. It's best to contact them, ask for a Total Commander ID and what they think is the best solution for line breaks.

I think it's \n, maybe they know better...

The funny thing is: If you google for "line breaks in descript.ion files" you will find THIS thread at position 1... ;)

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 »

2gbo

Thanks for trying the script and thanks for your video description of the issue!

With V0.2.0 of TCEditCommentExtended the comment for multiple files is only applied to each file, when the "Set"-button is pressed.

I have changed this with version 0.3.0 of the script. With 0.3.0 the comment for multiple files is applied to each file too, when the "Save"-button is clicked. Workflow now can be: Select files in TC - Start TCEditCommentExtended - Switch to tab "multiple files" - Enter comment - Press "Save" - Done


You can get V0.3.0 of TCEditCommentExtended here:
TCEditCommentExtended_0.3.0.zip (488 KiB)


Updated screenshots:
First one
Second one


Changes from 0.2.0 to 0.3.0

Added:
  • Comments for multiple files from different directories can be edited (multiple descript.ion files are handled). Useful for commenting files in branch view, for example. Current directory is shown above currently edited filename
  • Comment in "Multiple files" mode is applied automatically to all files, when "Save" button is clicked. When the latest changes to the "multi-comment" were already applied ("Apply"-button was clicked and no changes were made to the "multi-comment" afterwards), then the current "multi- comment" isn't applied once more on save.
  • WordWrap-function. Long lines are wrapped at the right edge of the comment editbox. These line breaks are not persistent. Use the "W"-button above the comment editbox to toggle word-wrapping.
  • Number of currently edited file and total number of selected files is shown below the "Prev"/"Next" buttons.
  • Number of file IDs in the currently edited comment is shown above the "File IDs" combobox.
  • Checkbox "Create backup". Initial state is read from the INI-file (key "CreateBackup"). When state of this checkbox changes, the belonging INI-value will be updated too.
  • Checkbox "\n = \r = CRLF" on "Search & Replace" tab. Initial state is read from the INI-file (key "AlterRexEx"). When state of this checkbox changes, the belonging INI- value will be updated too.
  • INI-key "DelObsDescExt"
    Abbreviation for "Delete Obsolete Description Extensions".
    0: Obsolete description extensions will be kept
    1: Obsolete description extension will be deleted
  • INI-key "ClipStripWS"
    Concerns only clipboard handling for wildcard "[Iclip]":
    0: Pass clipboard content as is
    1: Empty clipboard, when it contains nothing but whitespaces
  • Environment variables can be used in INI-key "ExecCommand".
    Environment variables must be enclosed in "%%". Example:
    ExecCommand="%%COMMANDER_PATH%%\PlugIns\wdxInfoPacker\bonus\CopyInfo2Clip.exe" /L=%L /S=NTFScomment
    Note: Environment variables are not yet supported in the dialog!

Changed:
  • Tab "Options" removed.
    "Font..." button can now be found above the comment edit box (this tiny "F"-button)
  • TCEditCommentExtended.exe and ArcInfo.exe compiled with user defined icon (actually it is icon "\AutoIt3\Icons\filetype2.ico" from AutoIt installation) to avoid virus alerts by McAfee AntiVirus (these alerts are false positives!)
  • Wildcards PCompany, PDescription, PFileVersion, PProductName, PProductVersion removed. These wildcards didn't work.

Fixed:
  • Length of descript.ion line (displayed below the comment edit box) wasn't calculated correct, when the general description exceeded 511 characters.
  • Working directory wasn't set to TC's source path. When a working directory was given in the button / menue definition, then the descript.ion was written to this directory.
  • "Next" button wasn't enabled, when last file was edited in "Single file" mode, then switched to "Multiple files" tab and then switched back again to "Single file" tab.
  • No error message was shown, when a comment to a packed file (inside an archive) should be saved.
User avatar
gbo
Senior Member
Senior Member
Posts: 329
Joined: 2005-03-31, 19:58 UTC
Location: Lausanne (Switzerland)

Post by *gbo »

2van Dusen,

Works perfectly now, I like the new features 8)

Thank you for all the work done.
Gil
Licence #17346

90% of coding is debugging. The other 10% is writing bugs.
Stiltzkin
Member
Member
Posts: 182
Joined: 2004-09-10, 17:15 UTC

Post by *Stiltzkin »

can anyone confirm that the 'TCEditCommentExtended.exe' and the 'ArcInfo.exe' within the TCEditCommentExtended_0.3.0.zip contains the signature of 'Worm/Sohanat.H' ?

thats what 'avira antivir' is telling me after the latest virus definition update...
hope its a false alarm...
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply