Log file for using Ocean scripting

Discussion in 'Cadence' started by madhero, May 15, 2008.

  1. madhero

    madhero Guest

    Hi Members,

    I have a question about saving log files for "ocean" command.
    If I use the command like this:

    ocean <oceanscript.ocn>script.log

    If there is already a script.log exists, ocean will say "File exists"
    and quit. How can I simply replace the previous log file? Thank you!
     
    madhero, May 15, 2008
    #1

  2. I think the command that you are using by default overwrites the
    existing file. Could you confirm this once again.

    If its not overwriting then you could add a line in the ocean script
    itself to delete that particular file in the begining of the
    simulation. Consult OCEAN documentation in this regard.

    Cheers,
    Naveen.
     
    solidrepellent, May 15, 2008
    #2
  3. madhero

    PM Guest

    $ man your_favotite_shell # ... and hopefully not 'csh'
    /noclobber
     
    PM, May 15, 2008
    #3
  4. PM wrote, on 05/15/08 13:08:
    In other words, this is a UNIX thing, and is nothing whatsoever to do with
    ocean...

    I did try also doing:

    ocean -restore oceanscript.ocn -log script.log

    but ocean does some messing around with the port variables to create this pseudo
    text terminal - and so any printed output doesn't end up in the log file.

    Instead I can do:

    icms -restore oceanscript.ocn -log script.log -nographE

    and that does it. -nographE is similar to -nograph, except that graphical
    windows can still be opened (as with "ocean").

    Regards,

    Andrew.
     
    Andrew Beckett, May 15, 2008
    #4
  5. madhero

    Riad KACED Guest

    1. What about the solution Given by Andrew in a previous post ?
    http://groups.google.com/group/comp...822?lnk=gst&q=ocean+log+file#3af511a9fdce6822

    Well it's slightly different since the ocean script is loaded into the
    CIW rather than running from a UNIX shell but It does not really
    matter to you ? doesn't it ?

    2. From Unix, did you try :
    cat yourOcean.ocn | ocean >! ocean.log ?
    This is an idea that springs to my mind but I didn't try myself since
    I'm off-Line.

    ==> PM: What's the matter with csh ? Have you got real issues with it
    or just a fun of "Csh Programming Considered Harmful" ?
    http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

    Emmmm, I'm nosy ...

    Riad.
     
    Riad KACED, May 16, 2008
    #5
  6. madhero

    madhero Guest

    Errr, If I use ocean -restore oceanscript.ocn > script.log, it quits
    if there's already a file, but works properly if not. But if I use
    ocean -restore oceanscript.ocn -log script.log, it overwrites the
    file, but did not actually save the right log file.
     
    madhero, May 16, 2008
    #6
  7. madhero

    madhero Guest

    Deleting the specific file in the ocean file is not the solution,
    because the ocean file won't be loaded if the file exists...
    And yes, I am using csh.
     
    madhero, May 16, 2008
    #7
  8. madhero

    madhero Guest

    Yes, I am using csh... And I tried, if I use bash, it will overwrite
    the existing file...
    It's a good idea to try to delete the particular file if it exists
    before using this command, but not in the ocean file, because it won't
    be loaded if the log file exists. I will use the unix command to
    delete it. Thank you
     
    madhero, May 16, 2008
    #8
  9. madhero

    PM Guest

    Once more again:
    Redirecting (>) is done bye the shell (in your case 'csh')
    and has nothing to do with ocean ...

    With your favourite shell you have 2 choices:

    1) general (in your shell)

    $ unset noclobber

    2) particular (for the command issued):

    $ ocean < oceanscript.ocn >! script.log
     
    PM, May 16, 2008
    #9
  10. madhero

    madhero Guest

    Thank you! I understand now...
    The file name is used as standard output. If the file
    does not
    exist then it is created; if the file exists, it is
    truncated,
    its previous contents being lost.

    If the shell variable noclobber is set, then the file
    must not
    exist or be a character special file (e.g., a
    terminal or
    $B!F(B/dev/null') or an error results. This helps prevent
    acciden$B!>(B
    tal destruction of files. In this case the $B!F(B!'
    forms can be
    used to suppress this check.
     
    madhero, May 16, 2008
    #10
  11. madhero wrote, on 05/16/08 04:34:
    Errr, isn't that what I said?

    Andrew.
     
    Andrew Beckett, May 18, 2008
    #11
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.