FileExtension 2021.10.29.2108

There is a newer version of this package available.
See the version list below for details.
dotnet add package FileExtension --version 2021.10.29.2108
NuGet\Install-Package FileExtension -Version 2021.10.29.2108
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="FileExtension" Version="2021.10.29.2108" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FileExtension --version 2021.10.29.2108
#r "nuget: FileExtension, 2021.10.29.2108"
#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.
// Install FileExtension as a Cake Addin
#addin nuget:?package=FileExtension&version=2021.10.29.2108

// Install FileExtension as a Cake Tool
#tool nuget:?package=FileExtension&version=2021.10.29.2108

FileExtension

Recognizers of file extensions codecov Nuget .NET Docs

What it does

This project helps you to see that a file has the correct extension

What it recognize

There are 344 extensions of files ( 16 tested) . See https://fileextension.readthedocs.io/en/latest/BDD/LightBDDReport/

Please help by making a PR by adding files to https://github.com/ignatandrei/FileExtension/tree/master/src/TestFileExtensions/TestFiles

How to use it

Simple use

Add a reference to Nuget ,

Console.WriteLine("Hello World!");
var r = new RecognizerPlugin.RecognizePlugins();
foreach (var item in r.AllExtensions())
{
    Console.WriteLine(item);
}
//find the sln
var dir =new DirectoryInfo( Directory.GetCurrentDirectory());
while(dir != null){
    string file = Directory.GetFiles(dir.FullName, "*.sln").FirstOrDefault();
    if(file == null)
    {
        dir = dir.Parent;
        continue;
    }
    var fileExtension = Path.GetExtension(file);
    var canRecognize = r.CanRecognizeExtension(fileExtension);
    Console.WriteLine($"file {file} can be  recognized {canRecognize}");
    //found sln, now recognize
    var byts = await File.ReadAllBytesAsync(file);
    var found = r.RecognizeTheFile(byts, fileExtension);
    Console.Write($"file {file} is recognized {found}");
    return;
}

Contributors ✨

Thanks goes to these wonderful people (emoji key):

<table> <tr> <td align="center"><a href="http://msprogrammer.serviciipeweb.ro/"><img src="https://avatars.githubusercontent.com/u/153982?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrei Ignat</b></sub></a><br /><a href="https://github.com/ignatandrei/RecordVisitors/commits?author=ignatandrei" title="Tests">⚠️</a> <a href="https://github.com/ignatandrei/RecordVisitors/commits?author=ignatandrei" title="Code">💻</a></td> </tr> </table>

This project follows the all-contributors specification. Contributions of any kind welcome!

Licence

The code in this project is licensed under MIT license.

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

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2021.11.2.1330 400 11/2/2021
2021.10.29.2108 336 10/29/2021
2021.10.29.540 318 10/29/2021