Commit Graph

8 Commits

Author SHA1 Message Date
Andreas Kling
b07bbf383d Userland: Run clang-format on everything. 2019-06-07 11:49:31 +02:00
Andreas Kling
0058da734e Kernel: Add Inode::truncate(size).
- Use this to implement the O_TRUNC open flag.
- Fix creat() to pass O_CREAT | O_TRUNC | O_WRONLY.
- Make sure we truncate wherever appropriate.
2019-03-27 16:42:30 +01:00
Andreas Kling
28a6ba498a Userland: Fix broken permissions for files created by /bin/cp.
When passing O_CREAT to open(), it will grab a third "mode" argument from
the stack. Let's not forget to actually pass this!

Also use the process umask for the created files.
2019-03-07 23:23:07 +01:00
Andreas Kling
3079ef01ce Userland: /bin/cp needs to handle open(dst) failing with EISDIR. 2019-03-06 20:28:00 +01:00
Andreas Kling
7d46375690 Userland: Support "cp foo somedirectory"
Don't overwrite the literal directory inode contents when copying a file
to a directory, duh. :^)
2019-03-06 20:22:23 +01:00
Andreas Kling
1b16a29044 Kernel+Userland: Implement fchmod() syscall and use it to improve /bin/cp.
/bin/cp will now copy the permission bits from source to destination. :^)
2019-03-01 10:39:19 +01:00
Andreas Kling
c4c475b49d /bin/cp: Handle partial write() case. 2019-01-27 10:04:53 +01:00
Andreas Kling
15fad649ea Userland: Make a simple /bin/cp for copying files. 2019-01-27 07:18:26 +01:00