Tutorials
Docs
Store
Pricing
Blog
Discuss
Login
Sign up
How to
How it works
API reference
Hotkeys & mouse controls
File types
sjs-4
sjs-4e
accept-2
app-1
contextmenu-1
css-1
css-2
css-2-wrapper
html-1
image-1
markdown-1
sh-1
static-1
deprecated types
accept-1
sjs-3
Injected variables
Collection
File
Attributes
Execution
Misc
Mutation
copy
move
new
remove
rename
Properties
Traversal
os
User
util
File links
App interface
HTML classes
Filesystem Query Language
Reserved namespaces
Glossary
WARNING: The [sjs-3] engine was
deprecated
, use [sjs-4] instead. See sjs-4:
rename
.
File.prototype.rename()
Rename a file.
Syntax
file.rename(name string)
Description
Rename a file.
Examples
Example.
temp = new File() A = temp.new(os.APPEND, "A", 0) B = temp.new(os.APPEND, "B", 0) temp.children().each(function(file) { os.print(file.path() + "\n") }) os.print("\n") A.rename("renamed") temp.children().each(function(file) { os.print(file.path() + "\n") })
Run
Subscribe to our newsletter!
Subscribe me
Product
Sign up
Changelog
Download
Status
Pricing
Terms & Conditions
Privacy Policy
Community
Twitter
Reddit
Company
Open Positions
Team
Contact