Feature Request: Add lsof Command

Open
#61 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

Start by reviewing the existing command implementations and the referenced winuxcmd project, then compare the Win32 API, Windows Native API, NtQuerySystemInformation, and NtQueryObject approaches mentioned in the issue. Done means the project provides an lsof command that identifies processes holding files on Windows, with behavior and privilege requirements defined for the implementation.

Written by the indexing model from the issue text.

Description

C-feature P-backlog

Based on #56: “If they have an equivalent on either Linux or macOS, are commonly installed by default, and commonly used: Yes, absolutely.”

I’m proposing the implementation of the lsof command here. lsof (“list open files”) is a very commonly used command, and Windows does not provide a similar command. This is especially useful when I want to delete a file but the file is in use: the usual Windows methods for finding what is occupying the file are often cumbersome, while lsof can quickly identify the problem.

This can be implemented through the Win32 API, Windows Native API, NtQuerySystemInformation, NtQueryObject, etc. — at least, that is how we do it in the winuxcmd project. Of course, this requires administrator privileges; otherwise, the Windows kernel will deny access.

Image
Dominant language
Rust
Stars
5.2k
Forks
107
Avg merge
2d 19h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/coreutils

All issues in microsoft/coreutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.