-
Notifications
You must be signed in to change notification settings - Fork 8
[feature] Detect POSIX special files #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for detecting and properly handling POSIX special files (block devices, character devices, FIFOs, and sockets) on Linux and macOS systems. The implementation prevents the inventory builder from attempting to read these files, which could cause hangs or errors.
Changes:
- Introduced a new
FileSystemEntryKindenum andPosixFileTypeClassifierservice to detect POSIX special files using Mono.Posix.NETStandard - Modified
InventoryBuilderto classify files before processing and skip special files, marking them as inaccessible - Added unit and integration tests for POSIX file detection and FIFO handling on Linux/macOS
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ByteSync.Client/Business/Inventories/FileSystemEntryKind.cs | New enum defining file system entry types including special POSIX files |
| src/ByteSync.Client/Interfaces/Controls/Inventories/IPosixFileTypeClassifier.cs | Interface for classifying POSIX file types |
| src/ByteSync.Client/Services/Inventories/PosixFileTypeClassifier.cs | Implementation using Mono.Unix syscalls to detect special files |
| src/ByteSync.Client/Services/Inventories/InventoryBuilder.cs | Integrated POSIX classifier to skip special files during inventory building |
| src/ByteSync.Client/ByteSync.Client.csproj | Added Mono.Posix.NETStandard package dependency |
| tests/ByteSync.Client.UnitTests/Services/Inventories/PosixFileTypeClassifierTests.cs | Unit tests for character device detection |
| tests/ByteSync.Client.IntegrationTests/Services/Inventories/TestInventoryBuilder.cs | Integration test verifying FIFO files are properly skipped |
| tests/ByteSync.Functions.IntegrationTests/End2End/E2E_Environment_Setup.cs | Added Azure Functions environment variables (unrelated to main feature) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/ByteSync.Client/Services/Inventories/PosixFileTypeClassifier.cs
Outdated
Show resolved
Hide resolved
tests/ByteSync.Functions.IntegrationTests/End2End/E2E_Environment_Setup.cs
Show resolved
Hide resolved
src/ByteSync.Client/Services/Inventories/PosixFileTypeClassifier.cs
Outdated
Show resolved
Hide resolved
src/ByteSync.Client/Services/Inventories/PosixFileTypeClassifier.cs
Outdated
Show resolved
Hide resolved
tests/ByteSync.Client.IntegrationTests/Services/Inventories/TestInventoryBuilder.cs
Show resolved
Hide resolved
|



Summary
Implementation