Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#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)

posixunix.scm.patch (917 bytes) - added by Alan Post 10 years ago.
Patch to add fchdir syscall to chicken-core.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by Alan Post

Attachment: posixunix.scm.patch added

Patch to add fchdir syscall to chicken-core.

comment:1 Changed 10 years ago by felix winkelmann

Owner: set to felix winkelmann
Status: newassigned
Type: defectenhancement

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 Changed 10 years ago by felix winkelmann

Would you mind terribly if I rename it to change-directory*? That way it would correspond with open-input-file*`, etc.

comment:3 in reply to:  2 Changed 10 years ago by Alan Post

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 Changed 10 years ago by felix winkelmann

Resolution: fixed
Status: assignedclosed

Has been added in "master" - thanks again, Alan.

comment:5 in reply to:  4 Changed 10 years ago by Alan Post

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.

comment:6 Changed 9 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.