#669 closed enhancement (fixed)
please add ability to call fchdir to posix module.
Reported by: | Alan Post | Owned by: | felix winkelmann |
---|---|---|---|
Priority: | minor | Milestone: | 4.9.0 |
Component: | core libraries | Version: | 4.7.x |
Keywords: | Cc: | ||
Estimated difficulty: |
Description
The fchdir call is like the chdir call, except it takes an open file descriptor rather than a filepath.
Using this call on Unix is more reliable for keeping a handle on where you are in the filesystem, relative to using a pathname: a file descriptor will point to the same resource even when the path (or a component of it) is renamed.
Will you apply this patch to chicken-core?
- I'm not certain at all I've selected a good name for this routine. Will you perfect the name change-directory/fd?
- I'm not sure how to implement it on w32, so I have not modified posixwin.scm.
If this patch is not acceptable, what must I do to get it applied?
Attachments (1)
Change History (7)
Changed 13 years ago by
Attachment: | posixunix.scm.patch added |
---|
comment:1 Changed 13 years ago by
Owner: | set to felix winkelmann |
---|---|
Status: | new → assigned |
Type: | defect → enhancement |
There is no such thing for Windows, I'm afraid. Thanks for the suggestion, I'll add this (plus a stub for posixwin.scm).
comment:2 follow-up: 3 Changed 13 years ago by
Would you mind terribly if I rename it to change-directory*? That way it would correspond with
open-input-file*`, etc.
comment:3 Changed 13 years ago by
Replying to felix:
Would you mind terribly if I rename it to
change-directory*? That way it would correspond with
open-input-file*`, etc.
I don't mind one bit. change-directory/fd was the best name I could come up with, but I was not happy with it. I like your proposal for change-directory*
, let us use that.
comment:4 follow-up: 5 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Has been added in "master" - thanks again, Alan.
comment:5 Changed 13 years ago by
Replying to felix:
Has been added in "master" - thanks again, Alan.
There is an extra closing parenthesis in this patch that will need to be removed. I've done so locally and this change is working for me, I've renamed all of my calls to the now-official name.
Patch to add fchdir syscall to chicken-core.