i1 : src = temporaryFileName() | "/"
o1 = /tmp/M2-62845-0/0/
|
i2 : dst = temporaryFileName() | "/"
o2 = /tmp/M2-62845-0/1/
|
i3 : makeDirectory (src|"a/")
|
i4 : makeDirectory (src|"b/")
|
i5 : makeDirectory (src|"b/c/")
|
i6 : src|"a/f" << "hi there" << close
o6 = /tmp/M2-62845-0/0/a/f
o6 : File
|
i7 : src|"a/g" << "hi there" << close
o7 = /tmp/M2-62845-0/0/a/g
o7 : File
|
i8 : src|"b/c/g" << "ho there" << close
o8 = /tmp/M2-62845-0/0/b/c/g
o8 : File
|
i9 : stack findFiles src
o9 = /tmp/M2-62845-0/0/
/tmp/M2-62845-0/0/b/
/tmp/M2-62845-0/0/b/c/
/tmp/M2-62845-0/0/b/c/g
/tmp/M2-62845-0/0/a/
/tmp/M2-62845-0/0/a/g
/tmp/M2-62845-0/0/a/f
|
i10 : copyDirectory(src,dst,Verbose=>true)
--copying: /tmp/M2-62845-0/0/b/c/g -> /tmp/M2-62845-0/1/b/c/g
--copying: /tmp/M2-62845-0/0/a/g -> /tmp/M2-62845-0/1/a/g
--copying: /tmp/M2-62845-0/0/a/f -> /tmp/M2-62845-0/1/a/f
|
i11 : copyDirectory(src,dst,Verbose=>true,UpdateOnly => true)
--skipping: /tmp/M2-62845-0/0/b/c/g not newer than /tmp/M2-62845-0/1/b/c/g
--skipping: /tmp/M2-62845-0/0/a/g not newer than /tmp/M2-62845-0/1/a/g
--skipping: /tmp/M2-62845-0/0/a/f not newer than /tmp/M2-62845-0/1/a/f
|
i12 : stack findFiles dst
o12 = /tmp/M2-62845-0/1/
/tmp/M2-62845-0/1/a/
/tmp/M2-62845-0/1/a/f
/tmp/M2-62845-0/1/a/g
/tmp/M2-62845-0/1/b/
/tmp/M2-62845-0/1/b/c/
/tmp/M2-62845-0/1/b/c/g
|
i13 : get (dst|"b/c/g")
o13 = ho there
|
Now we remove the files and directories we created.