We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d66fa60 commit dd595feCopy full SHA for dd595fe
Shell/main.cpp
@@ -296,7 +296,7 @@ static int run_command(const String& cmd)
296
break;
297
}
298
case Redirection::FileWrite: {
299
- int fd = open(redirection.path.characters(), O_WRONLY | O_CREAT, 0666);
+ int fd = open(redirection.path.characters(), O_WRONLY | O_CREAT | O_TRUNC, 0666);
300
if (fd < 0) {
301
perror("open");
302
return 1;
0 commit comments