Page 1 of 1

relative path doesn't works for copyas() itemlist

Posted: 12 May 2011 09:24
by Stefan
Minor wish to make it easier:

For copyas() I have to use an full path for the itemlist
but it should be enough to specify the name only
if the item is in the current working folder:

Code: Select all

 foreach($i, $items, "<crlf>")
 {
 if ($i==""){break;}
      //copyas [pattern], [targetpath], [itemlist]

      //this absolute path for itemlist works:
      copyas $i . "_2.xml", ,"<curpath>\Test.xml";

     //relative path doesn't works for itemlist:
     copyas $i . "_2.xml", ,"Test.xml";
 }
------------------

Test

i have this in the same folder:

Test.xml 10byte
Number1.xml 50byte
Number2.xml 50byte
Number3.xml 50byte


and i want that:

Test.xml 10byte
Number1.xml 50byte
Number1_2.xml 10byte
Number2.xml 50byte
Number2_2.xml 10byte
Number3.xml 50byte
Number3_2.xml 10byte

Re: relative path doesn't works for copyas() itemlist

Posted: 12 May 2011 09:57
by admin
Done. :)

Re: relative path doesn't works for copyas() itemlist

Posted: 13 May 2011 09:41
by Stefan
admin wrote:Done. :)

Code: Select all

v9.90.0912 - 2011-05-12 10:17
    + SC copyas: Now the itemlist parameter supports relative (to current
      list path) paths, e.g.:
        ::copyas "copy-*.png", ,"1.png|2.png";

Sure enough it works :D , thank you.

Code: Select all

foreach($i, $items, "<crlf>")
{
if ($i==""){break;}
      //copyas [pattern], [targetpath], [itemlist]

     //relative path works NOW for itemlist:
     copyas $i . "_2.xml", ,"Test.xml";
}