C Program to rename a directory in Unix or Linux operating systems using system call rename().
#include<stdio.h>
main()
{
char s[10],d[10];
printf("Enter source Dir Name:\n");
scanf("%s",s);
printf("Enter New Dir Name:\n");
scanf("%s",d);
if(rename(s,d)==-1)
perror("Can't be changed\n");
else
printf("%s is changed to %s\n\n",s,d);
}
Information about resetting and configuring Mobile phones (Java, Android, Symbian etc), educational articles especially for programming in C, C++ and Java and more about Computers and operating systems
Using System calls in C Program to rename a Directory in Linux
Labels:
$ccpp
,
c program
,
code
,
compiled
,
directory
,
How to
,
lab
,
Linux
,
operating Systems
,
OS
,
OS lab
,
programming
,
rename
,
source code
,
system call
,
UNIX
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment