Skip to content

Conversation

@paul-fresquet
Copy link
Contributor

Summary

  • Detect POSIX special files (block/char/FIFO/socket) using Mono.Posix.NETStandard
  • Skip special files during inventory building to avoid hangs and mark them inaccessible
  • Add Linux/macOS tests for /dev/null, /dev/zero, and FIFO handling

Implementation

  • Added a POSIX file type classifier and entry kind enum (client-side)
  • Integrated classification into inventory analysis to short-circuit special files
  • Added unit and integration tests for POSIX environments

Copy link
Contributor

Copilot AI left a 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 FileSystemEntryKind enum and PosixFileTypeClassifier service to detect POSIX special files using Mono.Posix.NETStandard
  • Modified InventoryBuilder to 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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2026

@paul-fresquet paul-fresquet merged commit 35d1e34 into master Feb 2, 2026
25 checks passed
@paul-fresquet paul-fresquet deleted the feature/259-posix-special-files branch February 2, 2026 15:52
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.

2 participants