7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept xml:lang="en" id="GUID-EC567597-093B-50C8-90FF-300A439A99A5"><title>How to rename files</title><prolog><metadata><keywords/></metadata></prolog><conbody><section id="GUID-9F2B6D05-E1A6-55AA-8FB9-D951581CAE36"><title>Using Rename()</title> <p>The following code fragment does not rename the directory <filepath>bottomdir</filepath>, but moves it from directory <filepath>middledir</filepath> to <filepath>topdir</filepath>:</p> <codeblock id="GUID-EBBD3412-0CEB-5A9D-8757-AAC27F9071E6" xml:space="preserve">RFs fs; |
12 <concept id="GUID-EC567597-093B-50C8-90FF-300A439A99A5" xml:lang="en"><title>How |
|
13 to rename files</title><shortdesc>This topic describes how to rename files.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-9F2B6D05-E1A6-55AA-8FB9-D951581CAE36"><title>Using Rename()</title> <p>The |
|
15 following code fragment does not rename the directory <filepath>bottomdir</filepath>, |
|
16 but moves it from directory <filepath>middledir</filepath> to <filepath>topdir</filepath>:</p> <codeblock id="GUID-EBBD3412-0CEB-5A9D-8757-AAC27F9071E6" xml:space="preserve">RFs fs; |
13 ... |
17 ... |
14 _LIT(KOldDir,"\\topdir\\middledir\\bottomdir\\"); |
18 _LIT(KOldDir,"\\topdir\\middledir\\bottomdir\\"); |
15 _LIT(KNewDir,"\\topdir\\bottomdir\\"); |
19 _LIT(KNewDir,"\\topdir\\bottomdir\\"); |
16 ... |
20 ... |
17 fs.Rename(KOldDir,KNewDir);</codeblock> </section> <section id="GUID-9CBFDD0C-FC17-573D-A99C-2F288FB28ED8"><title>Using IsValidName()</title> <p>When specifying a name, any spaces between the drive, if specified, and the first directory in the path are illegal.</p> <p>The following code fragment returns false:</p> <codeblock id="GUID-BD7ADA50-96C2-5C70-8761-35ABF25932B6" xml:space="preserve">... |
21 fs.Rename(KOldDir,KNewDir);</codeblock> </section> |
|
22 <section id="GUID-9CBFDD0C-FC17-573D-A99C-2F288FB28ED8"><title>Using IsValidName()</title> <p>When |
|
23 specifying a name, any spaces between the drive, if specified, and the first |
|
24 directory in the path are illegal.</p> <p>The following code fragment returns |
|
25 false:</p> <codeblock id="GUID-BD7ADA50-96C2-5C70-8761-35ABF25932B6" xml:space="preserve">... |
18 _LIT(KDirName,"C: \\DIR\\"); |
26 _LIT(KDirName,"C: \\DIR\\"); |
19 TBool bool=fs.IsValidName(KDirName); |
27 TBool bool=fs.IsValidName(KDirName); |
20 ...</codeblock> </section> </conbody></concept> |
28 ...</codeblock> </section> |
|
29 </conbody></concept> |