06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ename pREPC+ <strong>System</strong> <strong>Calls</strong><br />

rename Renames a file.<br />

#include <br />

#include <br />

int rename(<br />

const char *old, /* existing file name */<br />

const char *new /* new file name */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

This function changes the name of a file from old to new. It applies only to pHILE+managed<br />

files. If a file new already exists, it is deleted. Certain error conditions<br />

specific to the volume type can result, as follows:<br />

■ If a file called new exists and is open, the call fails (except on NFS volumes).<br />

■ If old is open, the call fails (DOS volumes only).<br />

■ If old is a directory file, the call fails (DOS volumes only).<br />

old Points to the string that contains the old filename.<br />

new Points to the string that contains the new filename.<br />

This function returns zero if the file is successfully renamed. If an error occurs,<br />

errno is set, and a nonzero value is returned.<br />

Refer to Appendix B.<br />

3-126 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!