bitburner-src/doc/source/netscript/basicfunctions/mv.rst

22 lines
667 B
ReStructuredText
Raw Normal View History

2023-01-30 19:51:00 +01:00
mv() Netscript Function
==============================
.. js:function:: mv(hostname, sourceFile, targetFile)
2023-01-30 19:51:00 +01:00
:RAM cost: 0 GB
:param string hostname: Hostname of the target server.
:param string sourceFile: Name of the file to be moved/renamed.
:param string targetFile: Target name of the file.
2023-01-30 19:51:00 +01:00
Move the source file to target file on the given server.
This command only works for scripts and text files (.txt). It cannot, however, be used to convert from script to text file, or vice versa.
This function can also be used to rename files.
Examples:
.. code-block:: javascript
2023-02-07 15:26:02 +01:00
ns.mv("home", "foo.js", "old_foo.txt")