|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 466 (0x1d2)
Types: TextFile
Names: »rename.c«
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
└─⟦bfebc70e2⟧ »EurOpenD3/mail/sendmail-5.65b+IDA-1.4.3.tar.Z«
└─⟦f9e35cd84⟧
└─⟦this⟧ »sendmail/support/rename.c«
/* @(#)rename.c 1.2 7/30/90 21:38:48 */
#ifndef lint
static char sccs_id[] = "@(#)rename.c 1.2";
#endif
#include <unistd.h>
rename(old, new)
char *old, *new;
{
/* first make sure there's something to rename */
if (access(old, F_OK) < 0)
return(-1);
/* get rid of any existing target file */
if (access(new, F_OK) == 0)
unlink(new);
/* link the old to the new */
if (link(old, new) < 0)
return(-1);
/* unlink the old name */
return(unlink(old));
}