NetcoreFSL 1.0.3

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

NetcoreFSL

CI

Versión: 1.0.3 · Estado: estable (Fases 0–6)
aka: NetCore FastSearchLibrary

Biblioteca multiplataforma y multi-hilo para .NET 8, escrita en C#, que permite buscar archivos y directorios en el sistema de archivos mediante patrones, con API basada en eventos.

Características

  • Búsqueda recursiva de archivos y carpetas por patrón
  • API basada en eventos (FilesFound, FoldersFound, ciclo de vida)
  • Ejecución síncrona o en segundo plano (ExecuteHandlers)
  • Cancelación, pausa y reanudación
  • Paralelismo acotado y seguro entre hilos
  • 21 tests automatizados (xUnit), verificados en .NET 8 y en CI (GitHub Actions)

Requisitos

  • .NET 8 SDK o superior (ver global.json para versión mínima)

Instalación

Referencia al proyecto (desarrollo)

git clone https://github.com/alanjmrt94/netcore-fsl.git
cd netcore-fsl
dotnet build netcore-fsl.sln

En su .csproj:

<ItemGroup>
  <ProjectReference Include="ruta/a/netcore-fsl/NetcoreFSL/NetcoreFSL.csproj" />
</ItemGroup>

Paquete NuGet

Tras publicar un release (tag v*.*.* + secret NUGET_API_KEY en GitHub), instale con:

dotnet add package NetcoreFSL

Instrucciones para mantenedores: docs/CI.md. Script todo-en-uno: ./scripts/release.sh.

Inicio rápido

using NetcoreFSL;
using NetcoreFSL.Searcher.Enums;

var fsl = new FSL(ExecuteHandlers.InCurrentTask, "/etc", ".conf");

fsl.FilesFound += (_, e) =>
{
  foreach (var file in e.Files)
    Console.WriteLine(file.FullName);
};

fsl.SearchCompleted += (_, e) =>
  Console.WriteLine($"Completado: {e.IsCompleted}");

fsl.FileSearch();

API pública

Clase FSL

Miembro Descripción
FSL.Version Versión semántica (1.0.3)
FSL(handler, folder, pattern) Constructor
FSL(handler, folder, pattern, cancellationToken) Constructor con cancelación
FileSearch() Búsqueda recursiva de archivos
FolderSearch() Búsqueda recursiva de carpetas
CancelSearch() Cancela la búsqueda activa
PauseSearch() Pausa la búsqueda activa
ResumeSearch() Reanuda la búsqueda pausada

Eventos

Evento Cuándo se dispara
DrivesFound Al enumerar unidades (folder = "", "*" o "/")
FilesFound Archivos que coinciden con el patrón
FoldersFound Carpetas que coinciden con el patrón
SearchCanceled Al cancelar
SearchCompleted Al finalizar (IsCompleted = éxito)
SearchPaused / SearchResumed Al pausar / reanudar

ExecuteHandlers

Valor Comportamiento
InCurrentTask Bloquea el hilo llamador hasta finalizar
InNewTask Ejecuta en Task.Run y retorna de inmediato

Patrones

Tipo Entrada Normalizado
Archivo .pdf *.pdf
Archivo *.log *.log
Carpeta systemd systemd
Carpeta cache* cache*

Comportamiento entre búsquedas

  • Los eventos persisten en la instancia FSL.
  • Una nueva FileSearch() / FolderSearch() cancela la búsqueda anterior.
  • Use instancias separadas para búsquedas concurrentes independientes.

Ejemplos

Búsqueda de carpetas

var fsl = new FSL(ExecuteHandlers.InCurrentTask, "/etc", "systemd");
fsl.FoldersFound += (_, e) =>
{
  foreach (var dir in e.Folders)
    Console.WriteLine(dir.FullName);
};
fsl.FolderSearch();

Cancelación y segundo plano

using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var fsl = new FSL(ExecuteHandlers.InNewTask, "/var/log", ".log", cts.Token);
fsl.SearchCompleted += (_, e) => Console.WriteLine(e.IsCompleted);
fsl.FileSearch(); // retorna de inmediato

Verificación y pruebas

Tests automatizados (.NET 8)

dotnet test netcore-fsl.sln -c Release

Resultado verificado: 21/21 pruebas OK, 0 errores, 0 warnings (Release).

CI en cada push/PR: ver badge arriba y docs/CI.md.

Detalle en docs/VERIFICATION.md.

Proyecto de prueba manual

dotnet run --project NetcoreTEST -- /etc .conf file sync
dotnet run --project NetcoreTEST -- /etc systemd folder async

Argumentos: <carpeta> <patron> [file|folder] [sync|async]

Variables de entorno: FSL_FOLDER, FSL_PATTERN, FSL_MODE, FSL_HANDLER, FSL_TIMEOUT_MS

Limitaciones conocidas

Limitación Detalle
Symlinks Pueden generar visitas duplicadas; se detectan ciclos por ruta visitada
Rutas largas (Windows) Prefijo \\?\ aplicado automáticamente en rutas locales y UNC
InNewTask Excepciones no se propagan al hilo llamador; use SearchCompleted
Workloads Snap SDK vía Snap puede mostrar aviso de workloads; ver docs/VERIFICATION.md

Estructura del repositorio

netcore-fsl/
├── NetcoreFSL/          # Biblioteca principal
├── NetcoreFSL.Tests/    # Tests xUnit (21 pruebas)
├── NetcoreTEST/         # Consola de prueba manual
├── docs/
│   ├── VERIFICATION.md  # Verificación .NET 8
│   └── CI.md            # GitHub Actions y publicación NuGet
├── scripts/
│   └── release.sh       # Build, test, pack, NuGet y GitHub Release
└── CHANGELOG.md

Versión en tiempo de ejecución

Console.WriteLine(FSL.Version);        // "1.0.3"
Console.WriteLine(FSLVersion.Current); // "1.0.3"

Fuente de verdad: NetcoreFSL/NetcoreFSL.csproj<Version>.

Versionado

Semantic Versioning. Historial en CHANGELOG.md.

Versión Hito
1.0.3 GitHub Actions CI y pipeline de publicación NuGet
1.0.2 Pausa/reanudación, rutas largas Windows, fix deadlock
1.0.1 Tooling, licencia y configuración de entorno
1.0.0 Release estable — Fases 0–5
0.5.0 Tests y migración .NET 8
0.4.0 Búsqueda de carpetas
0.3.0 API de ciclo de vida

Licencia

MIT — Copyright (c) 2021-2026 Alan Javier Martinez

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net8.0

    • No dependencies.

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
1.0.6 101 7/5/2026
1.0.3 94 7/5/2026