• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. For changing the slash in the path of the file to be loaded...

Stats

  • Replies 4
  • Subscribers 160
  • Views 13833
  • Members are here 0
More Content

For changing the slash in the path of the file to be loaded.

Panglossian
Panglossian over 14 years ago

Hello every1,

Each and everytime we need to change BACK slash into FRONT slash for loading in the allegro pcb editor.we can ge the use gets() to get the "\",but how to replace it with "/".Posts,comments/queries are welcome.I would be really happy if its posted within this week.Each time i hav to change the slash in notepad and have to upload,quite a task.

Thanks ,

Panglossian

  • Sign in to reply
  • Cancel
  • fxffxf
    fxffxf over 14 years ago

     You could look at  axlOSSlash(t_name)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Panglossian
    Panglossian over 14 years ago

    Hi fxffxf,

    Thanks a lot for dat inbuilt function.But still am finding problem with back slash,since it does not accept anything after the backslash.It shows as an error each and every time.Do u have nay format for that.

    Thanks a lot,

    Panglossian

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • fxffxf
    fxffxf over 14 years ago

    The backslash in Skill is typically used as an escape character when processed by any of the standard IO APIs (e.g. printf). This is also true in C/C++.  This is why the axl APIs (like axlDMFileBrowse) return files with directory components using the forward slash (also called UNIX style).

    If you want to use the backslash (\) you need to be carefull what APIs will operate on the string containing the backslash. You may (or may not have to escape the backslash to preserve it (e.g. replace the '\' with a "\\")). This can be problamatic to manage which is why I recommend if you have filenames always manage them using UNIX style directory paths ('/')

     As a example you want to have a directory with backslashes that you want to add a filename. You attempt to do:

        sprintf(buf "d:\foo\%s" filename)

    This  will result in an error. Instead you need to escape the escape characters

        sprintf(buf "d:\\foo\\%s" filename)

    Now you will see skill echo: "d:\\foo\\a.txt" but this is correct

    You can see the problem if you do: axlOSSlash("\c\d\"). In this case, the backslash is escaping the 2 'd' chars plus more importantly the final double quote (").  Result when Skill evaluates this line it throws an error. To have it work correctly you need escape the escapes: axlOSSlash("\\c\\d\\").

    I am just guessing this is your problem. You would have to post an example if my guess is not correct.

    If you get outside Allegro (like a bat file), you will find Microsoft is not consistent in its support of the forward slashes in filenames. Some of its programs will handle it and others won't. So if you need to generate files containing filenames then you will need to test to see if they support forward slashing and if they don't you will need to convert the filenames to utilize backslashes.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Ejlersen
    Ejlersen over 14 years ago

    Hi

    Does an opposite axlOSSlash exist?

    If not, I'll just have to write it :-(

    Best regards

    Ole

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information