feat: update to .NET 10 and support deleting reserved device name files (NUL)#47
Open
feat: update to .NET 10 and support deleting reserved device name files (NUL)#47
Conversation
…ce names (NUL, CON, etc.) - Update TargetFramework to net10.0 and SDK to 10.0.100 - Update all CI workflows to use dotnet 10.0.x - Add detection and deletion of Windows reserved device name files using \\?\ prefix - Handle Path.GetFullPath resolving reserved names to \\.\NUL by resolving parent dir separately - Add tests for deleting NUL files directly and within directories - Bump version to 1.6.0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
.NET 10 upgrade
TargetFrameworkfromnet9.0tonet10.0global.jsonSDK from9.0.200to10.0.100ci.yaml,release.yaml,benchmark.yaml) todotnet 10.0.xReserved device name file deletion (NUL, CON, PRN, etc.)
On Windows, files named
nul,con,prn, etc. are reserved device names that can't be deleted with standard APIs. These files can be created by cross-platform tools (e.g. git cloning a repo from Linux).This PR adds support for deleting them using the
\\?\extended-length path prefix:DirectoryUtils.IsReservedDeviceName\\?\prefix forFile.ExistsandFile.Deleteon reserved namesPath.GetFullPathresolving reserved names to\\.\by resolving the parent directory separatelyDeleteFileOrDirectory) and recursive directory deletion (DeleteFilesInFolder)Reference: https://gist.github.com/domsleee/c0e01497faa89667dc989630cab21945
Version bump
1.5.1→1.6.0Tests
DeletingFileWithReservedDeviceName— creates anulfile and deletes it directlyDeletingDirectoryContainingFileWithReservedDeviceName— deletes a directory containing anulfile