Rename a file: Difference between revisions
Content added Content deleted
(Add Processing) |
(→{{header|Processing}}: add root rename part of task) |
||
Line 915: | Line 915: | ||
=={{header|Processing}}== |
=={{header|Processing}}== |
||
<lang processing>void setup(){ |
<lang processing>void setup(){ |
||
⚫ | |||
// rename local file in sketch path |
|||
boolean sketchfold = rename(sketchPath("docs"), sketchPath("mydocs")); |
|||
String oldname = "input.txt"; |
|||
// sketches will seldom have write permission to root files/folders |
|||
String newname = "output.txt"; |
|||
boolean |
boolean rootfile = rename("input.txt", "output.txt"); |
||
boolean rootfold = rename("docs", "mydocs"); |
|||
println(oldname, newname, success); |
|||
// true if succeeded, false if failed |
|||
println(sketchfile, sketchfold, rootfile, rootfold); |
|||
// rename local folder in sketch path |
|||
oldname = "docs"; |
|||
newname = "mydocs"; |
|||
⚫ | |||
println(oldname, newname, success); |
|||
} |
} |
||