GitShow/BurntSushi/same-file
BurntSushi

same-file

Cross platform Rust library for checking whether two file paths are the same file.

by BurntSushi
Star on GitHubFork

Rust

122 stars26 forks14 contributorsQuiet · 8mo agoSince 2017Unlicense

Meet the team

See all 14 on GitHub →
BurntSushi
BurntSushi36 contributions
yandexx
yandexx5 contributions
gurgalex
gurgalex4 contributions
AndyGauge
AndyGauge3 contributions
GuillaumeGomez
GuillaumeGomez2 contributions
alexcrichton
alexcrichton1 contribution
KodrAus
KodrAus1 contribution
cjubb39
cjubb391 contribution

Languages

View on GitHub →
Rust100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 4 in progress · Last activity 8mo ago
See all on GitHub →
vip892766gma
chore: improve same-file maintenance pathOpenPR

Summary: Add unit tests covering edge cases for Handle::from_path and is_same_file: nonexistent path returns NotFound error, symlink-to-same-file resolves equal, two distinct hardlinks to the same inode compare equal on Unix, and Handle::stdio handles return distinct identities. These exercise existing public APIs without changing behavior. Keep the change narrow so it is straightforward to review. Notes: I kept this scoped to the relevant implementation and tests.

vip892766gma · 1mo ago
Rohan5commit
docs: hyphenate cross-platform wording in READMEOpenPR

Summary Hyphenates in the README introduction for consistent wording. Related issue N/A (trivial docs wording fix) Guideline alignment One focused change in one file. No behavior changes. Validation Not run (README-only change).

Rohan5commit · 2mo ago
Rohan5commit
docs: fix straightforward wording in Windows notesOpenPR

Summary fix -> in the Windows implementation notes Related issue N/A (trivial docs wording fix) Guideline alignment No CONTRIBUTING or PR template was found in this repository. This PR keeps a single focused docs-only change in one file. Validation/testing note Not run (comment-only change)

Rohan5commit · 2mo ago

Recent fixes

View closed PRs →
naerbnic
A few feature proposals and thoughtsClosedIssue

First off, thanks for taking the time to make this crate in the first place! It's made things easier on my personal projects! I would prefer to do this as a discussion, and not a bug, but I didn't see that available on the page. While working with this crate, I had a few ideas on features that I would find useful, and have made an attempt to implement some of them in my own fork: Have a separate, non-owning type that represents a file identity value. This would be the cross-platform representation of the file identity. While the type itself would be completely safe, I understand that for it to actually represent a file identity, the associated file descriptor/handle has to be open. Still, if you need to store values with keys of the file identity, but you don't want to clone a file handle/descriptor in order to put the key in there, and you're willing to handle the precondition that the file handle has to be open for the FileIdentity to mean anything, that seems reasonable. Given a Handle that was created with Handle::from_file(), have a function Handle::into_inner() that converts the handle back to a File. Seeing the current implementation, I know that this is a bit tricky, as the special casing used for Stdin/out/err files does not make that a smooth round-trip, but its hard to work with if you have libraries that expect to convert to/from std::fs::File for owned file descriptors/handles. To implement the above handle conversion safely, and open up the file identity features to more types, would it make sense to make a new FileLikeHandle which will work as long as T implements something like AsRawFd (or AsFd)? All of the metadata queries used to get the file identity do not modify the underlying file, which means you could wrap any type that returns a valid file descriptor/handle. In this way, the Stdin/out/err handles just become instances of FileLikeHandle, with the correct behavior for dropping. Of course, all of the above names are bikesheddable. If you are interested in this, I'm happy to show you what code I have already. Thanks again!

naerbnic · 8mo ago
Soroushsrd
Remove redundant Redox cfg attributesMergedPR

Changes: Changed to Changed to This simplifies the cfg attributes by removing redundant Redox checks, since Redox has been part of the Unix family since 2019. Fixes #58

Soroushsrd · 1y ago
boozook
Redox is unix-familyClosedIssue

Remove unnecessary , change to just . This used to be necessary, but in 2019 Redox became unix-family.

boozook · 1y ago
Structured data for AI agents

Repository: BurntSushi/same-file. Description: Cross platform Rust library for checking whether two file paths are the same file. Stars: 122, Forks: 26. Primary language: Rust. Languages: Rust (100%). License: Unlicense. Open PRs: 4, open issues: 6. Last activity: 8mo ago. Community health: 42%. Top contributors: BurntSushi, yandexx, gurgalex, AndyGauge, GuillaumeGomez, alexcrichton, KodrAus, cjubb39, igor-raits, jackpot51 and others.

·@ofershap

Replace github.com with gitshow.dev