Skip to content

win: use file path as ID when the filesystem doesn't support IDs#193

Merged
DHowett merged 9 commits intomainfrom
users/duhowett/file-path-id-3
May 21, 2025
Merged

win: use file path as ID when the filesystem doesn't support IDs#193
DHowett merged 9 commits intomainfrom
users/duhowett/file-path-id-3

Conversation

@DHowett
Copy link
Member

@DHowett DHowett commented May 21, 2025

Some Windows filesystems do not respond positively to FILE_ID_INFO requests.

On those filesystems, the best we can do is match on canonical file paths.

Closes #92

@DHowett DHowett requested a review from lhecker May 21, 2025 17:58
&& let Some(doc) = state.documents.active()
&& let Some(file_id) = &doc.file_id
&& sys::file_id_at(path).is_ok_and(|id| &id == file_id)
&& sys::file_id(None, doit.as_deref()).is_ok_and(|id| &id == file_id)
Copy link
Member Author

@DHowett DHowett May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If doit is None, file_id(None,None) will fail with Err. Technically this means we can remove line R116. WDYT?

@DHowett DHowett changed the title Allow file paths to be used as IDs when fs doesn't support IDs win: use file paths as IDs when the filesystem doesn't support IDs May 21, 2025
@DHowett DHowett changed the title win: use file paths as IDs when the filesystem doesn't support IDs win: use file path as ID when the filesystem doesn't support IDs May 21, 2025
Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat.

@DHowett DHowett merged commit 777d721 into main May 21, 2025
1 check passed
@DHowett DHowett deleted the users/duhowett/file-path-id-3 branch May 21, 2025 22:54
DHowett added a commit that referenced this pull request May 21, 2025
The fix in #193 required us to create FileIds even for nonexistent files.
That broke the creation of nonexistent files.
lhecker pushed a commit that referenced this pull request May 21, 2025
The fix in #193 required us to create FileIds even for nonexistent
files. That broke the creation of nonexistent files.
diabloproject pushed a commit to diabloproject/edit that referenced this pull request May 29, 2025
…rosoft#193)

Some Windows filesystems do not respond positively to `FILE_ID_INFO`
requests.

On those filesystems, the best we can do is match on canonical file
paths.

Closes microsoft#92
diabloproject pushed a commit to diabloproject/edit that referenced this pull request May 29, 2025
The fix in microsoft#193 required us to create FileIds even for nonexistent
files. That broke the creation of nonexistent files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when opening files on shares (including WSL)

2 participants