Soenneker.Extensions.FileInfo 4.0.613

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
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.614 82 9/15/2026
4.0.613 149 9/12/2026
4.0.612 458 8/30/2026
4.0.611 156 8/29/2026
4.0.610 459 7/27/2026
4.0.609 260 7/16/2026
4.0.608 1,474 6/18/2026
4.0.607 341 6/5/2026
4.0.606 364 4/22/2026
4.0.605 400 3/12/2026
4.0.604 198 3/12/2026
4.0.603 189 3/12/2026
4.0.602 227 3/12/2026
4.0.601 243 3/10/2026
4.0.600 238 3/9/2026
4.0.599 135 3/9/2026
4.0.598 184 3/9/2026
4.0.597 222 3/4/2026
4.0.596 539 1/8/2026
4.0.595 281 1/2/2026
Loading failed

Use NuGet trusted publishing in publishing workflows