lazebird.rabbit.fs
2.0.3
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
<PackageReference Include="lazebird.rabbit.fs" Version="2.0.3" />
paket add lazebird.rabbit.fs --version 2.0.3
#r "nuget: lazebird.rabbit.fs, 2.0.3"
// 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
public rfs(Action<string> log)
- Constructor
- log: log print function
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
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
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
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
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
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 | Versions 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. |
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.
support add/del file/dir in virtual file system