#MakePath
1 messages · Page 1 of 1 (latest)
yeah I saw that
no, not an option. I would much rather supply a path like I have written above
std.fs.cwd().makePath() will work with both relative and absolute paths
so even if you give it like C:/foobar it will work
but cwd() means current working directory?
yeah but it still works with absolute paths as well
the makePath function for the subpath? thats weird
you could also use std.posix.mkdir but both work anyways
the std.fs.openFileAbsolute for example looks like this:
https://github.com/ziglang/zig/blob/master/lib/std/fs.zig#L278-L281
(Simply calls cwd().openFile)
I didnt find anything in std, is there a function to extract from a path string the filename?
does linux not make this difficult since files can oftentimes have no file extension?
seems like a big os design flaw to me
*nix extensively uses file signatures -- the first few bytes in the file (e.g. shebang). Mac OS used to rely on the data fork of a file. File extensions are too constrained a namespace for many purposes. All choices have tradeoffs.
seems like a big tradeoff to me, cant easily judge from a pathname alone if its just a path or path+file
You still can't even with extensions. On Windows, there's nothing that prevents a folder from having an extension.