Samuel Venable

Results 15 comments of Samuel Venable

I've tested it, and it works on mac iirc. My fork works on macOS, I know that for certain, but I don't remember 100% whether I had to make any...

Here's what the solution would look like: https://github.com/time-killer-games/getexecname/blob/patch-1/getexecname.c Note this is a custom fork of someone else's code which is a C solution I modified to support getting the $PWD...

if the executable path fails to be retrieved for one reason or another, couldn't we check for nullptr or an empty string and in such a case use hard-coded "fish"...

> Tbh I hate the complexities of that code, the hoops we'd have to jump through. > > Because it relies on $PATH and the working directory, you need to...

To expand on my previous comment, here's some general notes from my research yesterday. I know you don't approve of this idea, I'm just putting it here for anyone who...

> I'm like a few days late on this, but I'm happy with how the NetBSD one went. It just needed different sysctl parameters to get the executable path for...

> > To get the vnode from a process id, you must get the struct process * from the process id using the function struct process *prfind(pid_t) declared in sys/proc.h....

I understand. It's hard to explain why we need those environment variables and argv[0]. The best i can offer is recommend you look at zig's implementation in the link you...

Ok so quick question... ``` maybe_t path_get_path(const wcstring &cmd, const environment_t &vars) { auto result = path_try_get_path(cmd, vars); if (result.err != 0) { return none(); } wcstring path = std::move(result.path);...

Thanks, good to know.