Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to use confirmdir command

    Hi everyone,

    I don't know how to use the confirmdir command.
    Here is in what I want to use it :

    I am double looping over folders containing folders:

    year folders 2012 to 2016 and in each year folder there are month folders.
    The 2016 folder contains months from January to June.

    Now I would like to execute some code after the double loop. But, because when I change directory to July it gives me an error, the code rest of the code is not executed.
    I think the command I need is confirmdir but I don't know how to use it.
    Could anyone help with this?

    Many thanks,


  • #2
    confirmdir (SSC, as you are asked to explain; please do read FAQ Advice 12.1) leaves 0 in r(confirmdir) if a directory exists and 170 otherwise:


    Code:
    . mkdir june6
    
    . confirmdir june6
    
    . ret li
    
    macros:
             r(confirmdir) : "0"
    
    . confirmdir june7
    
    . ret li
    
    macros:
             r(confirmdir) : "170"

    Comment


    • #3
      great, thank you Nick

      Comment

      Working...
      X