<doc>
  <legacy_id>2013</legacy_id>
  <name>rename</name>
  <type>command</type>
  <syntax>
    <example>rename [file | folder |directory] <i>filePath</i> to <i>newPath</i></example>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Files, Folders, &amp; Resources</category>
  </classification>
  <references>
    <command tag="create alias">create alias Command</command>
    <command tag="revCopyFile">revCopyFile Command</command>
    <function tag="tempName">tempName Function</function>
    <property tag="fileType">fileType Property</property>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
    <changed version="1.1.1"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Gives a <keyword tag="file">file</keyword> or <property tag="defaultFolder">folder</property> a new name or moves it to a new location or both.</summary>
  <examples>
    <example>rename file "Foo.txt" to "Bar.txt"</example>
    <example>rename folder "/bin/utilities/help" to "/public/utilities/new-help"</example>
  </examples>
  <description>
    <p>Use the <b>rename</b> <glossary tag="command">command</glossary> to change the name or location of a <keyword tag="file">file</keyword> or <property tag="defaultFolder">folder</property>.</p><p/><p><b>Parameters:</b></p><p>The <i>filePath</i> specifies the current <glossary tag="file path">name and location</glossary> of the <keyword tag="file">file</keyword> or <property tag="defaultFolder">folder</property> you want to rename or move. If you specify a name but not a location, LiveCode assumes the <keyword tag="file">file</keyword> or <property tag="defaultFolder">folder</property> is in the <property tag="defaultFolder">defaultFolder</property>.</p><p/><p>The <i>newPath</i> specifies the new <glossary tag="file path">name and location</glossary> of the <keyword tag="file">file</keyword> or <property tag="defaultFolder">folder</property>.</p><p/><p><b>Comments:</b></p><p>The <b>rename</b> <glossary tag="command">command</glossary> can be used to change a <glossary tag="file">file's</glossary> or <glossary tag="folder">folder's</glossary> location only if the old and new locations are both on the same volume.</p><p/><p><code/><img src="202650"/> <b>Caution!</b><code/> This <glossary tag="command">command</glossary> can be used to rename or move <function tag="files">files</function> and <function tag="folders">folders</function> your stack did not create. Of course, a <object tag="stack">stack</object> should not rename or move <function tag="files">files</function> and <function tag="folders">folders</function> it didn't create without obtaining explicit confirmation from the user.</p><p/><p><b>Changes:</b></p><p>The ability to move a file or folder on Mac OS and Windows systems with the <b>rename</b> <glossary tag="command">command</glossary> was introduced in version 1.1.1. In previous versions, the <b>rename</b> <glossary tag="command">command</glossary> could be used only to change the name, not the location.</p>
  </description>
</doc>