/*Write A C Program To Create A File And Write Something in it using System Calls.*/
#include
#include
#include
#include
#include
#include
int main(int argc ,char *argv[])
{
int i=0,fd;
for(i=1;i
{
fd=creat(argv[i],S_IREAD|S_IWRITE);
write(fd,"file created",12);
write(1,"file created\n",13);
close(fd);
}
return 0;
}
See Also:
#include
#include
#include
#include
#include
#include
int main(int argc ,char *argv[])
{
int i=0,fd;
for(i=1;i
{
fd=creat(argv[i],S_IREAD|S_IWRITE);
write(fd,"file created",12);
write(1,"file created\n",13);
close(fd);
}
return 0;
}
See Also:
Comments
Post a Comment