%O substitute selected filename w/o extension problem

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
evanscott
Junior Member
Junior Member
Posts: 9
Joined: 2003-06-10, 20:08 UTC
Location: Moutain View, California

%O substitute selected filename w/o extension problem

Post by *evanscott »

I am convinced that the %O parameter option results in truncation if the selected file name contains a space. For instance:

wunzip -d %N %O

comes out

wunzip -d "my zip file.zip" my

when I think it shou dcome out

wunzip -d "my zip file.zip" "my zip file"

Am I missing something or is this the way it works? More importantly, is this the way it is supposed to work?
Control Aich
User avatar
Vansumsen
Power Member
Power Member
Posts: 761
Joined: 2003-11-09, 08:16 UTC
Location: Belgique
Contact:

Post by *Vansumsen »

Found in TC Help > Configuration > Change buton bar > Parameters :
%O = places the current filename without extension into the command line.
Ouistiti, #11943

L'important n'est pas de convaincre, mais de donner à réfléchir.
The important thing is not to convince, but to incite to think.

1,77245385090552...
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Re: %O substitute selected filename w/o extension problem

Post by *Sheepdog »

evanscott wrote: wunzip -d %N %O

comes out

wunzip -d "my zip file.zip" my

when I think it shou dcome out

wunzip -d "my zip file.zip" "my zip file"

Am I missing something or is this the way it works?


Try wunzip -d %N "%O" because of the spaces in the filename and it should work as you expect. ( I don't know why %N works fine without quotation marks)

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
evanscott
Junior Member
Junior Member
Posts: 9
Joined: 2003-06-10, 20:08 UTC
Location: Moutain View, California

Post by *evanscott »

I would have sworn I had tried that but when I did try it it worked so I must not have tried it. Maybe I tried quoting both arguments and that broke it the other way around... what'a world! Thanks for the help!
Control Aich
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

evanscott wrote:I would have sworn I had tried that but when I did try it it worked so I must not have tried it.
Sometimes it happens like this :lol:
evanscott wrote: Maybe I tried quoting both arguments and that broke it the other way around... what'a world!
I tried it again: If you use %N in quotation marks you only get the part to the first space. So it is at least inconsistent....
evanscott wrote: Thanks for the help!
You're welcome

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

%N and %P%N are surrounded automatically by quotation marks, because they often stand alone as parameters. %O is usually needed to create new names, e.g. %O.bak, therefore it wouldn't be good to have "" placed automatically around it. Therefore you have to add the double quotes yourself.
Author of Total Commander
https://www.ghisler.com
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

ghisler(Author) wrote:%N and %P%N are surrounded automatically by quotation marks, because they often stand alone as parameters. %O is usually needed to create new names, e.g. %O.bak, therefore it wouldn't be good to have "" placed automatically around it. Therefore you have to add the double quotes yourself.
Thanks for the quick reply. Sounds logical to me. But I think it's worth mentioning in the tutorial. I'll give Clo a hint.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Post Reply