next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc > The Macaulay2 language > file manipulation > copyFile(String,String)

copyFile(String,String)

Synopsis

Description

i1 : src = temporaryFileName()

o1 = /tmp/M2-21664-0/0
i2 : dst = temporaryFileName()

o2 = /tmp/M2-21664-0/1
i3 : src << "hi there" << close

o3 = /tmp/M2-21664-0/0

o3 : File
i4 : copyFile(src,dst,Verbose=>true)
--copying: /tmp/M2-21664-0/0 -> /tmp/M2-21664-0/1
i5 : get dst

o5 = hi there
i6 : copyFile(src,dst,Verbose=>true,UpdateOnly => true)
--skipping: /tmp/M2-21664-0/0 not newer than /tmp/M2-21664-0/1
i7 : src << "ho there" << close

o7 = /tmp/M2-21664-0/0

o7 : File
i8 : copyFile(src,dst,Verbose=>true,UpdateOnly => true)
--skipping: /tmp/M2-21664-0/0 not newer than /tmp/M2-21664-0/1
i9 : get dst

o9 = hi there
i10 : removeFile src
i11 : removeFile dst

See also