How to get current file name?

Discussion in 'Cadence' started by scyoyo, Nov 18, 2008.

  1. scyoyo

    scyoyo Guest

    Hello, guys~~
    A problem~~ I wanna to get the current filename in Allegro by SKILL.
    eg: I open "a.brd" and I wanna to use a SKILL command to get its
    filename and save it in a variable.
    But after I search through the SKILL manual, I can't find such
    commands. There's only command getCurrentDir().
    Who knows? or can I find another way to get my filename such as using
    "axlShell"?
    Thank you~~
     
    scyoyo, Nov 18, 2008
    #1
  2. scyoyo

    Riad KACED Guest

    Hi There,

    If you open a file called "a.brd", the you can get the full resolved
    path to your file using the 'simplifyFilename' skill function.
    this is a quick reference form the doc:

    simplifyFilename(
    t_name
    [ g_dontResolveLinks ]
    )
    => t_result

    This a little example:
    ;1
    myFileName= "helloScyoyo.txt"
    myFilePath=simplifyFilename(myFileName)
    ;2
    myFilePort=outfile(myFileName "a")
    myFilePath=simplifyFilename(get_filename(myFilePort))

    Hope this helps !
    Riad.
     
    Riad KACED, Nov 18, 2008
    #2
  3. scyoyo

    Riad KACED Guest

    Hi There,

    If you open a file called "a.brd", the you can get the full resolved
    path to your file using the 'simplifyFilename' skill function.
    this is a quick reference form the doc:

    simplifyFilename(
    t_name
    [ g_dontResolveLinks ]
    )
    => t_result

    This a little example:
    ;1
    myFileName= "helloScyoyo.txt"
    myFilePath=simplifyFilename(myFileName)
    ;2
    myFilePort=outfile(myFileName "a")
    myFilePath=simplifyFilename(get_filename(myFilePort))

    Hope this helps !
    Riad.
     
    Riad KACED, Nov 18, 2008
    #3
  4. scyoyo

    scyoyo Guest

    Thank you Riad~~
    But I still have a question~~
    You know, the simplifyFilename function can only get the path of the
    current file, but I can't get the file name

    I can open a file by using file-->open or axlShell("open ...")
    but my purpose is to extract some infomation from a.brd and then open
    a .dra file in Allegro to compare the data. After finishing this. I
    want to open the a.brd again and show my results. I hope that all the
    process could be done automatically so I need to record the filename
    of a.brd in previous step.

    Then how can I get the filename without opening a file manually? Is
    there any special expression, symbol or function that can represent
    the current name? (eg: "./" or getWorkingDir(), is there getFileName
    or some similar func?)
     
    scyoyo, Nov 20, 2008
    #4
  5. scyoyo

    fogh Guest

    fogh, Nov 23, 2008
    #5
  6. scyoyo

    scyoyo Guest

    scyoyo, Nov 25, 2008
    #6
  7. scyoyo

    scyoyo Guest

    Hi Riad~~ I think I get it
    A function axlCurrentDesign() can get the current design name
     
    scyoyo, Nov 27, 2008
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.