Opened 5 years ago

Last modified 5 years ago

#15774 new enhancement

Add ability to retrieve path of file descriptor

Reported by: X512 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This is hrev53917.

Currently there are no ability to retrieve path of file descriptor. _kern_entry_ref_to_path(dev, node, NULL, path, B_OS_NAME_LENGTH) is only work for directories.

All major OS are support this feature:

  • Windows: GetFileInformationByHandleEx with FileNameInfo.
  • Linux: Path can be retrieved from /proc/self/fd/<fd>.
  • Mac OS X: fcntl(fd, F_GETPATH, filePath).

Change History (1)

comment:1 by X512, 5 years ago

My utility to inspect file descriptors: https://github.com/X547/HaikuUtils/tree/master/Handles.

Last edited 5 years ago by X512 (previous) (diff)
Note: See TracTickets for help on using tickets.