Prev, Top Notes, Next

Using the Library
Threads

if (rename(old_path, new_path) < 0)
{
    char buf[300];
    strerror_r(errno, buf, sizeof(buf));
    fprintf(stderr, "rename %s %s: %s\n",
        buf);
    exit(1);
}
 
if (rename(old_path, new_path) < 0)
{
    char buf[3000];
    explain_message_rename(buf, sizeof(buf),
        old_path, new_path);
    fprintf(stderr, "%s\n", msg);
    exit(1);
}
if (rename(old_path, new_path) < 0)
{
    int err = errno;
    char buf[300];
    strerror_r(err, buf, sizeof(buf));
    fprintf(stderr, "rename %s %s: %s\n",
        buf);
    exit(1);
}
 
if (rename(old_path, new_path) < 0)
{
    int err = errno;
    char buf[3000];
    explain_message_errno_rename(buf, sizeof(buf),
        err, old_path, new_path);
    fprintf(stderr, "%s\n", msg);
    exit(1);
}