ready to deploy
This commit is contained in:
parent
1091e2413f
commit
565c172b21
1 changed files with 1 additions and 1 deletions
2
main.c
2
main.c
|
@ -123,7 +123,7 @@ int main()
|
||||||
strcpy(fileName, args[i_lastArg]); //saving file name before cleaning the array
|
strcpy(fileName, args[i_lastArg]); //saving file name before cleaning the array
|
||||||
freeRemainderInArr(args, i_lastArg);
|
freeRemainderInArr(args, i_lastArg);
|
||||||
|
|
||||||
int fd = open(fileName, O_RDWR | O_CREAT | O_TRUNC);
|
int fd = open(fileName, O_RDWR | O_CREAT , S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP| O_TRUNC);
|
||||||
if(fd >= 0)
|
if(fd >= 0)
|
||||||
{
|
{
|
||||||
dup2(fd, 1); // make stdout go to file
|
dup2(fd, 1); // make stdout go to file
|
||||||
|
|
Loading…
Reference in a new issue