Make a backup file: Difference between revisions

no edit summary
m (→‎{{header|Lasso}}: comment out initial first time run file creation, and explain)
No edit summary
Line 13:
 
Some examples on this page assume that the original file already exists. They might fail if some user is trying to create a new file.
 
 
=={{header|AutoHotkey}}==
<lang autohotkey>targetfile := "ahk-file"
if FileExist(targetfile)
FileMove, %targetfile%, %targetfile%.bak
else
FileAppend,, %targetfile%
file := FileOpen(targetfile, "w")
if !IsObject(file)
{
MsgBox Can't open "%FileName%" for writing.
return
}
file.Write("This is a test string.`r`n")
file.Close()</lang>
 
=={{header|Common Lisp}}==