lazebird.rabbit.fs 2.0.3

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

// Install lazebird.rabbit.fs as a Cake Tool
#tool nuget:?package=lazebird.rabbit.fs&version=2.0.3                

fs

Description

  • implement some advanced file system api

Target

API

  1. public rfs(Action<string> log)

    • Constructor
    • log: log print function
  2. public int addfile(Hashtable hs, string vpath, string rpath)

    • add a file to virtual file system in hashtable
    • hs: file system hashtable
    • vpath: file path in virtual file system
    • rpath: real path in file system
  3. public int delfile(Hashtable hs, string vpath, string rpath)

    • delete a file from virtual file system
    • hs: file system hashtable
    • vpath: file path in virtual file system
    • rpath: real path in file system
  4. public int adddir(Hashtable hs, string vpath, string rpath, bool recursive)

    • add a directory to virtual file system in hashtable
    • hs: file system hashtable
    • vpath: file path in virtual file system
    • rpath: real path in file system
    • recursive: recursive to add sub-directories
  5. public int deldir(Hashtable hs, string vpath, string rpath)

    • delete a directory to virtual file system in hashtable
    • hs: file system hashtable
    • vpath: file path in virtual file system
    • rpath: real path in file system
  6. public void readstream(Stream fs, rqueue q, int maxblksz)

    • read a stream and save to queue
    • fs: input file stream
    • q: resource queue, to store file data
    • maxblksz: max block size read and saved
  7. public void writestream(Stream output, rqueue q, string path, long length)

    • write queue data to stream
    • output: file stream
    • q: resource queue, stored file data
    • path: file path or name, used for log view
    • length: file total length, used to stop proc

Sample

```
void file_load(HttpListenerResponse response, string path)
{
    Stream output = response.OutputStream;
    response.ContentType = get_mime(get_suffix(path));
    //log("Info: response suffix " + get_suffix(uri) + " ContentType " + response.ContentType);
    FileStream fs = new FileStream((string)((rfile)fhash[path]).path, FileMode.Open, FileAccess.Read);
    response.ContentLength64 = fs.Length;
    rqueue q = new rqueue(10); // 10 * 10M, max memory used 100M
    new Thread(() => rfs.readfile(fs, q, 10000000)).Start();    // 10000000, max block size 10M
    new Thread(() => rfs.writefile(output, q, path, response.ContentLength64)).Start();
}
```
Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has 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
2.1.2 654 7/8/2019
2.1.1 766 9/11/2018
2.1.0 843 8/15/2018
2.0.9 841 7/31/2018
2.0.5 824 7/26/2018
2.0.3 812 7/23/2018

support add/del file/dir in virtual file system