Parameter for file name without extension or directory name.

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Parameter for file name without extension or directory name.

Post by *LonerD »

Example for clarification.

We have:
file - Its.my.file.txt
directory - Its.my.directory

And single command:

Code: Select all

[em_7Z_pack]
cmd=%commander_path%\Plugins\arc\7-Zip\7zG.exe
param=a -ad -scsUTF-16LE "%P%O.7z" @%WL
menu=7-Zip: Pack selected files
Expectations for result after compression file or directory:
Its.my.file.7z
Its.my.directory.7z

Reality:
Its.my.7z
Its.my.7z

--------------------
Another Example

Code: Select all

[em_7Z_maxLZMA]
cmd=%commander_path%\Plugins\arc\7-Zip\7zG.exe
param=a "%O.7z" -t7z -mx9 -m0=LZMA -mse -ssw -scsUTF-16LE -y @%WL
menu=7-Zip: Maximum compression LZMA
Expectations:
Its.my.file.7z
Its.my.directory.7z

Reality:
Its.my.file.txt.7z
Its.my.7z

----------------------
One more

Code: Select all

[em_RAR_pack_ms]
cmd=%commander_path%\Plugins\arc\Rar\Rar.exe a -m5 -s -ms -os -cfg- -o+ -ep1 -idcdp -c-
param="%O.rar" %S
menu=RAR: Pack with solid maximum compression
Expectations:
Its.my.file.rar
Its.my.directory.rar

Reality:
Its.my.file.rar
Its.my.rar

--------------------
Suggestion:
Parameter for file name without extension or directory name (considering that directories don't have extension in common sense).
Last edited by LonerD on 2023-05-28, 01:12 UTC, edited 4 times in total.
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: Parameter for file name without extension or directory name.

Post by *Gral »

Code: Select all

param=a -ad -scsUTF-16LE "%P%N.7z" @%WL
:?:
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Re: Parameter for file name without extension or directory name.

Post by *LonerD »

@Gral
If you tried to offer alternative, than it will be like

Code: Select all

a -ad -scsUTF-16LE "%P"%N".7z" @%WL
to avoid problem when names contain spaces.
But it's not solution even close. Because if we compressed several files (@%WL) - than %N return names WITH extensions.

Suggestion for clear file name and clear directory name without cutting or extension.

PS. Added another examples.
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3278
Joined: 2003-05-06, 11:46 UTC

Re: Parameter for file name without extension or directory name.

Post by *Sir_SiLvA »

when your folder is called Its.my.directory and you use the parameter %O then %O = Its.my because you told tc to look for the first point from the right side and only take everything left of the point as a filename.

and for me Its.my.file.txt with

Code: Select all

cmd=%commander_path%\Plugins\arc\7-Zip\7zG.exe
param=a "%O.7z" -t7z -mx9 -m0=LZMA -mse -ssw -scsUTF-16LE -y @%WL
turns it into Its.my.file.7z as expected.
Last edited by Sir_SiLvA on 2023-05-28, 01:15 UTC, edited 1 time in total.
Hoecker sie sind raus!
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3278
Joined: 2003-05-06, 11:46 UTC

Re: Parameter for file name without extension or directory name.

Post by *Sir_SiLvA »

LonerD wrote: 2023-05-28, 00:58 UTC @Gral
If you tried to offer alternative, than it will be like

Code: Select all

a -ad -scsUTF-16LE "%P"%N".7z" @%WL
to avoid problem when names contain spaces.
But it's not solution even close. Because if we compressed several files (@%WL) - than %N return names WITH extensions.

Suggestion for clear file name and clear directory name without cutting or extension.

PS. Added another examples.
when you want no cutting then why use %O in the firstplace?

ps: if you want no cutting of the filename dont use . in directory name but instead _
Hoecker sie sind raus!
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Re: Parameter for file name without extension or directory name.

Post by *LonerD »

Sir_SiLvA wrote: 2023-05-28, 01:14 UTC dont use . in directory name but instead _
You suggest to rename ALL directories on ALL computers and on ALL disks where I run Total Commander ? :shock: :o
Sir_SiLvA wrote: 2023-05-28, 01:14 UTCwhen you want no cutting then why use %O in the firstplace?
Because TC doesn't have another more suitable parameters :!:
That's why this topic was created - suggestion for new parameter like %O or %N, but with clear uncut name and without extension.
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter for file name without extension or directory name.

Post by *Fla$her »

%O for file and %Q%N for folder in one parameter.
Support++

2LonerD
Haven't you made a mistake anywhere? Some results look unpredictable.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter for file name without extension or directory name.

Post by *petermad »

%O for file and %Q%N for folder in one parameter.
%Q is already used for other purpose:
Help wrote:%Q Turn off automatic quotation marks around certain parameters like %P%N when the name contains a space. The user will then have to place them by himself.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter for file name without extension or directory name.

Post by *Fla$her »

petermad wrote: 2023-05-28, 14:13 UTC
%O for file and %Q%N for folder in one parameter.
%Q is already used for other purpose:
I want to remind you that %Q was added at my request.
Where do you see in my sentence that I propose to apply %Q for something else? Don't confuse.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter for file name without extension or directory name.

Post by *petermad »

2Fla$her
Where do you see in my proposal that I propose to apply %Q for something else?
Then please explain what you mean by:
%O for file and %Q%N for folder in one parameter.
Support++
Last edited by petermad on 2023-05-28, 14:40 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter for file name without extension or directory name.

Post by *petermad »

I suggest a new parameter %ON

The description should be:
%ON works as %O for files and as %N for directories.
Last edited by petermad on 2023-05-28, 19:19 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter for file name without extension or directory name.

Post by *Fla$her »

petermad wrote: 2023-05-28, 14:32 UTC Then please explain what you mean by:
I wrote "in one parameter". I didn't suggest a name.
Let it be %o, which will return the result as %O for a file or %Q%N for a folder.

%O doesn't return quotes, because it is often used in a construct with suffixes like .ext.
So, for consistency and convenience for the folder, it's logical to return a value similar to %Q%N, and not %N.
It was mentioned above.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14741
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Parameter for file name without extension or directory name.

Post by *petermad »

2Fla$her
Just to be clear - what you meant, written in a comlete sentence including a verb was:

"Support++ for a new parameter that works like %O for files and like %Q%N for folders."

See, I read your telegram style post, as if you wanted a new modifier parameter (%Q) that would make %N work as %O for folders - my mistake.


%O doesn't return quotes, because it is often used in a construct with suffixes like .ext.
So, for consistency and convenience for the folder, it's logical to return a value similar to %Q%N, and not %N.
Sure - so let me change my proposal to:
I suggest a new parameter %ON

The description should be:
%ON works as %O for files and as %N for directories without auto-quotes.
Last edited by petermad on 2023-05-28, 19:19 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: Parameter for file name without extension or directory name.

Post by *Fla$her »

petermad wrote: 2023-05-28, 15:25 UTC Just to be clear - what you meant, written in a comlete sentence including a verb was:
It was a concise name of the request, there was no need for any verb. ;)
Overquoting is evil! 👎
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3278
Joined: 2003-05-06, 11:46 UTC

Re: Parameter for file name without extension or directory name.

Post by *Sir_SiLvA »

petermad wrote: 2023-05-28, 15:25 UTC Sure - so let me change my proposal to:
I suggest a new parameter %ON

The description should be:
%ON woks as %O for files and as %N for directories without auto-quotes.
That seems like a point at which it would be better to get finally some script support
for the name field like >[file:%N|dir:%A] to achive what petermad described.
Hoecker sie sind raus!
Post Reply