Macaulay2 » Documentation
Packages » Macaulay2Doc > The Macaulay2 language > file manipulation > moveFile(String,String)
next | previous | forward | backward | up | index | toc

moveFile(String,String)

Synopsis

Description

i1 : src = temporaryFileName()

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

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

o3 = /tmp/M2-770950-0/0

o3 : File
i4 : moveFile(src,dst,Verbose=>true)
--moving: /tmp/M2-770950-0/0 -> /tmp/M2-770950-0/1
i5 : get dst

o5 = hi there
i6 : bak = moveFile(dst,Verbose=>true)
--backup file created: /tmp/M2-770950-0/1.bak

o6 = /tmp/M2-770950-0/1.bak
i7 : removeFile bak

See also

Ways to use this method: