1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +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:
Andreas Kling 2018-12-19 21:14:55 +01:00
parent e03d341615
commit 038d8641f9
22 changed files with 122 additions and 22 deletions

View file

@ -44,7 +44,7 @@ public:
byte fileType { 0 };
};
virtual bool set_mtime(InodeIdentifier, dword timestamp) = 0;
virtual int set_atime_and_mtime(InodeIdentifier, dword atime, dword mtime) = 0;
virtual InodeIdentifier create_inode(InodeIdentifier parentInode, const String& name, Unix::mode_t, unsigned size, int& error) = 0;
virtual InodeIdentifier create_directory(InodeIdentifier parentInode, const String& name, Unix::mode_t, int& error) = 0;
@ -85,6 +85,8 @@ public:
virtual InodeIdentifier lookup(const String& name) = 0;
virtual String reverse_lookup(InodeIdentifier) = 0;
int set_atime_and_mtime(Unix::time_t atime, Unix::time_t mtime);
protected:
CoreInode(FS& fs, unsigned index)
: m_fs(fs)