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

moveFile(String,String)

Synopsis

Description

i1 : src = temporaryFileName()

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

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

o3 = /tmp/M2-247418-0/0

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

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

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

See also