~sircmpwn/hare

hare/fs d---------
fs: style fix

Signed-off-by: Drew DeVault <sir@cmpwn.com>
path::{base,dir}name: match {base,dir}name(3p)

With path::basename("//") defined to return "/".

Signed-off-by: Eyal Sawady <ecs@d2evs.net>
all: overhaul switch/match syntax

This changes the syntax of switch and match expressions following
similar changes to harec et al.

match (x) {
	case type =>
		do_work();
		yield 10;
	case x: type =>
		process(x);
		yield 20;
	case =>
		abort();
};

Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Co-authored-by: Alexey Yerin <yyp@disroot.org>
fs: Change is_something functions to issomething

This is more consistent with the informal style guide, and function
names in other modules.

Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
fs::mem+test: drop harec workaround

Signed-off-by: Eyal Sawady <ecs@d2evs.net>
all: return io::file from os::open

Signed-off-by: Drew DeVault <sir@cmpwn.com>
fs: add open_file and create_file

Signed-off-by: Drew DeVault <sir@cmpwn.com>
fs: minor doc improvement

Signed-off-by: Drew DeVault <sir@cmpwn.com>
hash::hash: refactor with subtyping

This also updates the interface for hash::fnv to avoid any allocations.
Nice!

Signed-off-by: Drew DeVault <sir@cmpwn.com>
all: yield WIP

Signed-off-by: Drew DeVault <sir@cmpwn.com>
fs, unix::umask: don't clear file mode bits

Signed-off-by: Umar Getagazov <umar@handlerug.me>
fs::chmod: fix the permission mask

This commit also makes the code a bit more consistent.
fs::fs: improve docs

Signed-off-by: Drew DeVault <sir@cmpwn.com>
fs::move: use is_file instead of bitbanging mode

Signed-off-by: Drew DeVault <sir@cmpwn.com>
fs::move: assert that target is a regular file

Signed-off-by: Drew DeVault <sir@cmpwn.com>
fs::move: implement copy+delete fallback

Signed-off-by: Drew DeVault <sir@cmpwn.com>
fs: add fs::rename, fs::move

fs::move is not done yet; missing a fallback implementation.

Signed-off-by: Drew DeVault <sir@cmpwn.com>
fs: return errors::unsupported instead of abort()ing

Some functions were probably outdated and didn't return
errors::unsupported like others do. Crashing on unsupported operations
(1) makes assumptions about the underlying system, which is
unacceptable, and (2) prevents providing a fall-back implementation.

Signed-off-by: Alexey Yerin <yyp@disroot.org>
Update for error type syntactical changes
Revert match syntax changes

Signed-off-by: Eyal Sawady <ecs@d2evs.net>
Next