Soenneker.Extensions.FileInfo 4.0.613

Prefix Reserved
dotnet add package Soenneker.Extensions.FileInfo --version 4.0.613
                    
NuGet\Install-Package Soenneker.Extensions.FileInfo -Version 4.0.613
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Extensions.FileInfo" Version="4.0.613" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.FileInfo" Version="4.0.613" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.FileInfo" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Extensions.FileInfo --version 4.0.613
                    
#r "nuget: Soenneker.Extensions.FileInfo, 4.0.613"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Extensions.FileInfo@4.0.613
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Extensions.FileInfo&version=4.0.613
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.FileInfo&version=4.0.613
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Extensions.FileInfo

Checks and removes System.IO.FileAttributes flags through FileInfo.

Installation

dotnet add package Soenneker.Extensions.FileInfo

Check attributes

using System.IO;
using Soenneker.Extensions.FileInfo;

var file = new FileInfo("report.csv");

bool protectedOrArchived = file.HasReadOnlyOrArchivedAttribute();
bool both = file.HasAttributeSet(FileAttributes.ReadOnly | FileAttributes.Archive);

HasReadOnlyOrArchivedAttribute() returns true when either flag is present. HasAttributeSet() requires every requested flag to be present. Passing 0 to HasAttributeSet() returns true, following normal bitmask semantics.

Reading FileInfo.Attributes accesses filesystem metadata and can throw when the path is missing, inaccessible, or unsupported by the platform.

Remove attributes

file.RemoveReadOnlyOrArchivedAttribute();

// Or remove a specific combination:
file.RemoveAttribute(FileAttributes.ReadOnly | FileAttributes.Hidden);

Both methods modify the file’s attributes on disk. RemoveAttribute() does nothing when none of the requested flags are present; after a write it refreshes the FileInfo metadata. Filesystem access, permission, and platform exceptions propagate to the caller.

RemoveAttribute() accepts any FileAttributes flags, not only cosmetic flags. Avoid removing structural or platform-specific flags unless that is explicitly intended.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Extensions.FileInfo:

Package Downloads
Soenneker.Utils.FileSync

A utility library encapsulating synchronous file IO operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.613 50 9/12/2026
4.0.612 452 8/30/2026
4.0.611 152 8/29/2026
4.0.610 454 7/27/2026
4.0.609 257 7/16/2026
4.0.608 1,471 6/18/2026
4.0.607 339 6/5/2026
4.0.606 362 4/22/2026
4.0.605 398 3/12/2026
4.0.604 196 3/12/2026
4.0.603 187 3/12/2026
4.0.602 225 3/12/2026
4.0.601 241 3/10/2026
4.0.600 235 3/9/2026
4.0.599 131 3/9/2026
4.0.598 182 3/9/2026
4.0.597 220 3/4/2026
4.0.596 537 1/8/2026
4.0.595 279 1/2/2026
4.0.594 663 11/20/2025
Loading failed

Use NuGet trusted publishing in publishing workflows