1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>VFRename{File, Dir}(W)</title>
9</head>
10
11<body>
12
13<h1>VFRename{File, Dir}(W)</h1>
14
15<h2>C Specification</h2>
16<dl><dd><pre><code>
17#include &lt;revolution/vf.h&gt;
18
19typedef s32	VFErr;
20
21VFErr VFRenameFile( const char* old_name, const char* new_name );
22VFErr VFRenameFileW( const VFWchar* old_name, const VFWchar* new_name );
23VFErr VFRenameDir( const char* old_name, const char* new_name );
24VFErr VFRenameDirW( const VFWchar* old_name, const VFWchar* new_name );
25</code></pre></dd></dl>
26
27<h2>Arguments</h2>
28<p>
29<TABLE border="1" >
30  <tr>
31<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>old_name</EM></STRONG></CODE></TD>
32<TD width="520">File or directory name, with or without a path, that you want to change.</TD>
33  </tr>
34  <tr>
35<TD valign="top" width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>new_name</EM></STRONG></CODE></TD>
36<TD width="520">New file or directory name.</TD>
37  </tr>
38</TABLE>
39</p>
40
41<h2>Return Values</h2>
42<PRE>
43Returns 0 when successful
44Otherwise, returns <code><a href="./VFErr.html">VFErr</a></code> other than 0
45</PRE>
46
47
48<H2>Description</H2>
49<p>
50Changes a file or directory name.<br> It cannot move files or directories.<br> As a result, if the paths specified in <CODE><STRONG><EM>old_name</EM></STRONG></CODE> and <CODE><STRONG><EM>new_name</EM></STRONG></CODE> differ, an error will be returned.<br> When a path is not specified in <CODE><STRONG><EM>old_name</EM></STRONG></CODE>, a file in the current directory is targeted.<br> In addition, if only a file name or directory name is specified in <CODE><STRONG><EM>new_name</EM></STRONG></CODE>, the path is assumed to be the same as that specified in <CODE><STRONG><EM>old_name</EM></STRONG></CODE>.<br> <STRONG>Note:</STRONG> When the file or directory specified in <CODE><STRONG><EM>old_name</EM></STRONG></CODE> is open, or if its attributes are read-only (<CODE>VF_ATTR_RDONLY</CODE>), the name cannot be changed.</p>
51
52<h2>See Also</h2>
53<p>
54</p>
55
56<H2>Revision History</H2>
57<p>
582006/07/03<br>2007/05/08 Corrected errors.
59</p>
60
61
62<hr><p>CONFIDENTIAL</p></body>
63</html>
64