Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 2605

Macaulay2-1.3.1-8.fc15.i686.rpm

-- -*- M2-comint -*- {* hash: 423116033 *}

i1 : src = temporaryFileName() | "/"

o1 = /tmp/M2-20694-1/

i2 : dst = temporaryFileName() | "/"

o2 = /tmp/M2-20694-2/

i3 : makeDirectory (src|"a/")

i4 : makeDirectory (src|"b/")

i5 : makeDirectory (src|"b/c/")

i6 : src|"a/f" << "hi there" << close

o6 = /tmp/M2-20694-1/a/f

o6 : File

i7 : src|"a/g" << "hi there" << close

o7 = /tmp/M2-20694-1/a/g

o7 : File

i8 : src|"b/c/g" << "ho there" << close

o8 = /tmp/M2-20694-1/b/c/g

o8 : File

i9 : stack findFiles src

o9 = /tmp/M2-20694-1/
     /tmp/M2-20694-1/b/
     /tmp/M2-20694-1/b/c/
     /tmp/M2-20694-1/b/c/g
     /tmp/M2-20694-1/a/
     /tmp/M2-20694-1/a/g
     /tmp/M2-20694-1/a/f

i10 : copyDirectory(src,dst,Verbose=>true)
--copying: /tmp/M2-20694-1/b/c/g -> /tmp/M2-20694-2/b/c/g
--copying: /tmp/M2-20694-1/a/g -> /tmp/M2-20694-2/a/g
--copying: /tmp/M2-20694-1/a/f -> /tmp/M2-20694-2/a/f

i11 : copyDirectory(src,dst,Verbose=>true,UpdateOnly => true)
--skipping: /tmp/M2-20694-1/b/c/g not newer than /tmp/M2-20694-2/b/c/g
--skipping: /tmp/M2-20694-1/a/g not newer than /tmp/M2-20694-2/a/g
--skipping: /tmp/M2-20694-1/a/f not newer than /tmp/M2-20694-2/a/f

i12 : stack findFiles dst

o12 = /tmp/M2-20694-2/
      /tmp/M2-20694-2/b/
      /tmp/M2-20694-2/b/c/
      /tmp/M2-20694-2/b/c/g
      /tmp/M2-20694-2/a/
      /tmp/M2-20694-2/a/g
      /tmp/M2-20694-2/a/f

i13 : get (dst|"b/c/g")

o13 = ho there

i14 : rm = d -> if isDirectory d then removeDirectory d else removeFile d

o14 = rm

o14 : FunctionClosure

i15 : scan(reverse findFiles src, rm)

i16 : scan(reverse findFiles dst, rm)

i17 :