Difference between revisions of "Os.rename"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[os]]<br/>
 +
 
=== Description ===
 
=== Description ===
Renames file or directory named oldname to newname. If this function fails, it returns nil, plus a string describing the error.
+
Renames file or directory named oldname to newname. If this function fails, it returns nil plus a string describing the error.
<source lang="lua">
+
<syntaxhighlight lang="lua">
os.rename(oldname,newname)
+
os.rename(oldname,newname)
</source>
+
</syntaxhighlight>
 +
 
 
=== Parameters ===
 
=== Parameters ===
'''oldname''': (string) current name of the file <br/>
+
'''oldname''': (string) current file name<br/>
'''newname''': (string) new name of the file <br/>
+
'''newname''': (string) new file name<br/>
 +
 
 +
{{Os}}

Latest revision as of 14:32, 13 July 2023

Available since: Gideros 2011.6
Class: os

Description

Renames file or directory named oldname to newname. If this function fails, it returns nil plus a string describing the error.

os.rename(oldname,newname)

Parameters

oldname: (string) current file name
newname: (string) new file name