mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
Implement utime() along with a naive /bin/touch.
This synchronous approach to inodes is silly, obviously. I need to rework it so that the in-memory CoreInode object is the canonical inode, and then we just need a sync() that flushes pending changes to disk.
This commit is contained in:
parent
e03d341615
commit
038d8641f9
22 changed files with 122 additions and 22 deletions
16
Userland/touch.cpp
Normal file
16
Userland/touch.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
#include <stdio.h>
|
||||
#include <utime.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: touch <path>\n");
|
||||
return 1;
|
||||
}
|
||||
int rc = utime(argv[1], nullptr);
|
||||
if (rc < 0)
|
||||
perror("utime");
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue