flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > [feature request] cmd> fasm C:\bin\"hello world"

Author
Thread Post new topic Reply to topic
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
nik 17 Mar 2008, 05:11
fasm (WinXP, fasm v1.67.26) doesn't recognize command-line arguments which include *internal* quotation marks like
Code:
> fasm.exe c:\bin\"hello world".asm
    

it errs "source file not found"
[ UPD: i expected this to work because my own C++ app that uses <fstream> accepts it with no problems ]

[ UPD: such syntax is actually NOT standard ]

i met this inconvenience creating a batch file which takes file name as a parameter, like this:
fasmN.cmd
Code:
fasm.exe c:\bin\%1.asm
    


i know there is a workaround for it, but it's just a little inconvenient and confusing Sad
even more trouble if i have series of *.cmd which call each other with parameters

thanks in advance
-- nik


Last edited by nik on 18 Mar 2008, 05:30; edited 4 times in total
Post 17 Mar 2008, 05:11
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20423
Location: In your JS exploiting you and your system
revolution 17 Mar 2008, 05:21
The workaround is this:
Code:
fasm.exe "c:\bin\%1.asm"    
Post 17 Mar 2008, 05:21
View user's profile Send private message Visit poster's website Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
nik 17 Mar 2008, 05:24
no it isn't
if
Code:
%1=="hello world"
    

then
Code:
"c:\bin\%1.asm"=="c:\bin\"hello world".asm"
    

again internal quotes and error


Last edited by nik on 17 Mar 2008, 05:53; edited 1 time in total
Post 17 Mar 2008, 05:24
View user's profile Send private message Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
nik 17 Mar 2008, 05:30
actually works this:
Code:
fasm.exe "c:\bin\%~n1.asm"
    

and it confuses
Post 17 Mar 2008, 05:30
View user's profile Send private message Reply with quote
Grom PE



Joined: 13 Mar 2008
Posts: 114
Location: i@grompe.org.ru
Grom PE 17 Mar 2008, 07:33
Code:
> fasm.exe c:\bin\"hello world".asm
    

nik, never expect this to work. It would be actually three parameters.
If you want to remove quotes, use %~1 for substitution.
It's still not clear, what are you trying to do?
Post 17 Mar 2008, 07:33
View user's profile Send private message Visit poster's website Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
nik 17 Mar 2008, 08:15
2 Grom PE
basically i want to pass file name as a parameter to fasmN.cmd and add path and extension

if there's a space in a file name i can't do this:
> fasmN hello world
because there would be 2 params: %1==hello %2==world

so i do this:
> fasmN "hello world"
and
Code:
fasm.exe c:\bin\%1.asm    

doesn't work !

and i DO expect this would work because my own C++ app using standard header <fstream> handles such paths correctly
Post 17 Mar 2008, 08:15
View user's profile Send private message Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
nik 17 Mar 2008, 08:26
Grom PE wrote:

use %~1 for substitution.

yeah actually i didn't now this Embarassed
but it would be better if %1 worked too though
Post 17 Mar 2008, 08:26
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 17 Mar 2008, 10:01
do not see here any problem. call your file hello.asm - this definetly will help.
Post 17 Mar 2008, 10:01
View user's profile Send private message Visit poster's website Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
nik 17 Mar 2008, 10:51
2 shoorick
yes you're right but i want my cmd-files be more *general*
because i use them for my C-compiler (my task at university)
Post 17 Mar 2008, 10:51
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 17 Mar 2008, 14:21
nik: internal quotation marks aren't standard, neither Notepad or Notepad++ handles them. "type" from a command prompt does, though.
Post 17 Mar 2008, 14:21
View user's profile Send private message Visit poster's website Reply with quote
nik



Joined: 17 Mar 2008
Posts: 7
Location: Russia, Vladivostok
nik 18 Mar 2008, 05:17
2 f0dder
Sad too bad of me -- i have really thought otherwise
thanks for the info
Post 18 Mar 2008, 05:17
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 794
Location: Adelaide
sinsi 18 Mar 2008, 05:47
Have you looked at %* instead of %1 - it gives you the whole command-line parameter, including spaces (I think).
Post 18 Mar 2008, 05:47
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.