Rename a file: Difference between revisions

Content added Content deleted
No edit summary
Line 6: Line 6:
{{works with|gcc|4.1.2 20061115 (prerelease) (SUSE Linux)}}
{{works with|gcc|4.1.2 20061115 (prerelease) (SUSE Linux)}}


<c>#include <stdio.h>
<lang c>#include <stdio.h>


int main()
int main()
Line 15: Line 15:
rename("/docs", "/mydocs");
rename("/docs", "/mydocs");
return 0;
return 0;
}</c>
}</lang>
=={{header|ALGOL 68}}==
=={{header|ALGOL 68}}==
Note: <code>reidf</code> does not appear to be included in [[ALGOL 68G]]. Also note that file names would be Operating System dependent.
Note: <tt>reidf</tt> does not appear to be included in [[ALGOL 68G]]. Also note that file names would be Operating System dependent.
<pre>
<pre>
main:(
main:(
Line 156: Line 156:
=={{header|Python}}==
=={{header|Python}}==


<python>
<lang python>
import os
import os
Line 164: Line 164:
os.rename("/input.txt", "/output.txt")
os.rename("/input.txt", "/output.txt")
os.rename("/docs", "/mydocs")
os.rename("/docs", "/mydocs")
</python>
</lang>


=={{header|Ruby}}==
=={{header|Ruby}}==