Author Topic: Parentheses in path for command-line execution  (Read 2542 times)

FlashMagicUser

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Parentheses in path for command-line execution
« on: May 07, 2019, 02:20:25 am »
Referring to this post: http://forum.flashmagictool.com/index.php?topic=4338.0.

I am using command-line v11.00 but with a path containing "C:\Program Files (x86)\..." I still cannot make the command work.

Is there any way to run this command? Has something been done to improve that?

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Parentheses in path for command-line execution
« Reply #1 on: May 07, 2019, 04:03:21 am »
Try double backslashes, \\

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

FlashMagicUser

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Parentheses in path for command-line execution
« Reply #2 on: May 07, 2019, 06:30:55 am »
I already tried with
  • Double slashes
  • Quotes around the path
  • Double quotes around the path
  • Replacing spaces with slashes (i.e.: "C:\Program\Files\(x86)\...")
And I always get the same error.


I also just noticed that I get the error:
Code: [Select]
ERROR: Invalid parameters for HEXFILE directive: HEXFILE(C:\Program
Files
(x86)

But the exit code is
Code: [Select]
0
It would be great if we could at least catch the error via exit code.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Parentheses in path for command-line execution
« Reply #3 on: May 07, 2019, 06:39:10 am »
Export the command line directives from the GUI version (File menu). That will show you the valid syntax.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

FlashMagicUser

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Parentheses in path for command-line execution
« Reply #4 on: May 07, 2019, 07:08:37 am »
Oh, the irony.
I setup via GUI my desired function and it works fine.
But if I export the command line directives, I see that the string is exactly the same  as the one that gives me the error.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Parentheses in path for command-line execution
« Reply #5 on: May 07, 2019, 07:16:11 am »
Please post the entire HEXFILE directive you are using.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

FlashMagicUser

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Parentheses in path for command-line execution
« Reply #6 on: May 07, 2019, 07:24:30 am »
This is the entire command line directive:
Code: [Select]
COM(6, 115200)
DEVICE(LPC2368, 4.000000, 0)
HARDWARE(BOOTEXEC, 50, 100)
ERASE(DEVICE, PROTECTISP)
HEXFILE(C:\Program Files (x86)\My Company\My Software\myfile.hex, NOCHECKSUMS, NOFILL, PROTECTISP)

Just to clarify: this is the exact same string I get if I export Command Line Directive from the Flash Magic GUI software.
Just to clarify more: if I use any other path without parentheses (even with spaces, but no parentheses), the command executes fine.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Parentheses in path for command-line execution
« Reply #7 on: May 07, 2019, 07:29:27 am »
Parentheses are not allowed inside path names. Page 57 of the manual lists what is allowed. The V12 command line is all-new and doesn't have this restriction.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

FlashMagicUser

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Parentheses in path for command-line execution
« Reply #8 on: May 07, 2019, 07:47:43 am »
Thank you for your answers.

Is it possible to export the command line directive from GUI V12?