• 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. Custom IC SKILL
  3. How to move specific file from one directory to another...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 12176
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to move specific file from one directory to another one

saurabh96
saurabh96 over 3 years ago

Hello Everyone,

I have netlist abc.cdl in my PWD ,ALSO

My setting file is in other directory...also setting file path differs

i want to move my abc.cdl file from PWD to above  test/info directory.

How to achieve it from skill.

Regards,

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    The function is renameFile()

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 3 years ago in reply to Andrew Beckett

    Hello Andrew,

    thanks for suggestions...but it didn't work as i expected.

    let me explain you more clearly.

    I have setting file directory where all setting file is stored...but this path is variable .

    eg - for 40 nm  it is  ---/user/tech/40/setting/setting.file

    for 15nm --   /prog/list/15/setting.file.

    Also i selecting setting file via browse option.

    Now when i export netlist CDL using si.env and system("si -batch -command netlist"); 

    it is generating auCDL in my current working directory...

    I want that as soon as i set my setting file...the generated CDL moves from current working directory to respective tecg setting file direcrtory..i.e for 40nm it should go into ---/user/tech/40/setting   folder and for 15nm it should go into --  /prog/list/15/ folder.

    I hope it clears some clouds.

    Thanks in advance

    Robin

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 3 years ago in reply to saurabh96

    Hi , any update on this question-

    regards,

    Robin

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to saurabh96
    saurabh96 said:
    Hi , any update on this question

    If this is urgent, you should contact customer support. This forum is a community forum and not a substitute for support - I only answer questions in my spare time (it's not part of my job) and I was on vacation - so answering forum questions wasn't a priority. Having some downtime was.

    You didn't say why renameFile() wouldn't work (I think it should), plus if you're doing:

    system("si -batch -command netlist")

    presumably you could also do:

    system("si -batch -command netlist; mv netlist.cdl /user/tech/40/setting"); or whatever the CDL file you're generating is called.

    Your question was rather badly phrased, so it was very hard to know how to answer.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 3 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for suggestions..

    system("si -batch -command netlist; mv netlist.cdl /user/tech/40/setting");  here /user/tech/40/setting is variable path

    file_Label=hiCreateLabel(
    ?name 'file_Label
    ?labelText "Set File*"
    ?justification 'left
    )
    file_Entry=hiCreateStringField(
    ?name 'file_Entry
    ?callback "readSetFile(hiGetCurrentForm())"
    )

    browse_set_Entry=hiCreateButton(
    ?name 'browse_set_Entry
    ?buttonText "Browse..."
    ?callback "ddsFileBrowseCB(hiGetCurrentForm() 'set_file_Entry \"\" 'fileOnly)"
    )

    it will point to browse the  set file...

    i want that when the move netlist it should copy in that directory of above set file.

    Basically, how i can get that directory path .ie one step up from file path?

    Regards,

    Robin

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to saurabh96

    Robin,

    There's no built-in function to find the directory part of a file name (unfortunately) so you'd probably do something like:

    fileTailPattern=pcreCompile("/[^/]*$")
    fileName=myForm->set_file_Entry->value ; your code above seems to call the field either file_Entry or set_file_Entry, so I'm not sure which is correct
    dirName=pcreReplace(fileTailPattern fileName "" 1)
    sprintf(command "si -batch -command netlist; mv netlist.cdl %s" dirName)
    system(command)

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to saurabh96

    Robin,

    There's no built-in function to find the directory part of a file name (unfortunately) so you'd probably do something like:

    fileTailPattern=pcreCompile("/[^/]*$")
    fileName=myForm->set_file_Entry->value ; your code above seems to call the field either file_Entry or set_file_Entry, so I'm not sure which is correct
    dirName=pcreReplace(fileTailPattern fileName "" 1)
    sprintf(command "si -batch -command netlist; mv netlist.cdl %s" dirName)
    system(command)

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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