4 ms·
> The filesystem APIs could be extended with a "CWD" handle argument that can be passed around Why would you even want a working directory at that point?
by Dylan16807 5y ago
> The filesystem APIs could be extended with a "CWD" handle argument that can be passed around
Why would you even want a working directory at that point?
- elihu 5y agoWhat's the alternative? To use absolute paths for everything? That seems kind of tedious, and may be slightly less performant if the kernel has to do more dentry lookups. I think the idea of a current working directory is a reasonable one, it's just that the limitation that a process can only have one CWD at a time is kind of arbitrary when you think about it. I could even see having commands that take multiple CWDs. Like a move operation could take a source and a destination CWD as an alternative to specifying source and destination paths.
- Dylan16807 5y agoDirectory file descriptors already exist. I wouldn't call them "current working" directories though. Are you suggesting an expansion of those, or something different from those?