Giter Club home page Giter Club logo

platform.virtualfilesystem's People

Contributors

blachniet avatar tumtumtum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platform.virtualfilesystem's Issues

FileTransferService with Zip Files

I'm trying to transfer a file from disk into a file inside of a zip file using FileTransferService, but it doesn't seem to work. It gives me a file not found error.

        var zip = ZipFileSystem.CreateZipFile(FileSystemManager.Default.ResolveFile(@"C:\Users\Michael\Documents\Platform Test\A\storage.zip"), FileSystemOptions.Default);

        var target = zip.ResolveFile(@"fileInZip");

        var source = FileSystemManager.Default.ResolveFile(@"C:\Users\Michael\Documents\p1 - Copy.png");

        IFileTransferService service = source.GetService<IFileTransferService>(new FileTransferServiceType(target));
        service.Start();
        service.WaitForAnyTaskState(TaskState.Finished);

How to enter zip passwords

I access to my zip content using this :

var localDir =FileSystemManager.Default.ResolveDirectory("zip://[file://W:/Temp/cabinet.public/cabinet.zip]/cabinet");

It's ok when zip has no password, but not when zip content is password protected.
How can I set zip passwords?

Thank you

Exceptions when path contains some characters as percent encoding

When a folder contains the characters %3a I get an exception: "the given path's format is not supported. " When it contains %3c I get: "Illegal characters in path."

The problem seems to be that VFS is turning these into actual characters (i.e %3a is turned into a colon.)

These are causing issues when using INode.Name and also GetDirectories() (example: if the directory contains a folder with the name %3a inside of it.) It is also causing various other problems.

Read JPEG images from file system

How can one read a jpeg image directly from file system, for example in legacy file system we read JPEG as follows:

var stream=new FileStream(myFile,FileMode.Read);
var bmi = new BitmapImage();
bmi.BeginInit();
bmi.StreamSource = stream;
bmi.EndInit();
bmi.Freeze();

Cannot create imaginary files

//System.NotSupportedException
new ImaginaryFileSystem("file").RootDirectory.ResolveFile("foo").Create();

//Also System.NotSupportedException
new ImaginaryFileSystem("file").RootDirectory.ResolveFile("foo").Create(true);

:(

Problems with Platform.VirtualFileSystem v.1.0.0.68 - System.MissingMethodException

Dear tumtumtum,

I tried to use the latest version of Platform.VirtualFileSystem in my program. Unfortunately I get the following Exception:

Result Message: System.MissingMethodException : Method not found: 'System.Collections.Generic.IEnumerable1<!!0> Platform.EnumerableUtils.Distinct(System.Collections.Generic.IEnumerable1<!!0>)'.
Result StackTrace:
at Platform.VirtualFileSystem.FileSystemOptions..ctor(Type nodeCacheType, IList1 nodeServiceProviderTypes, IList1 nodeResolutionFilterTypes, IList1 nodeOperationFilterTypes, IList1 accessPermissionVerifierTypes, NameValueCollection variables)
at Platform.VirtualFileSystem.FileSystemOptions.get_Default()
at Platform.VirtualFileSystem.AbstractFileSystemManager.Resolve(String uri, NodeType nodeType, AddressScope scope)
at Platform.VirtualFileSystem.AbstractResolver.ResolveFile(String name, AddressScope scope)
at Platform.VirtualFileSystem.AbstractResolver.ResolveFile(String name)

I suppose, that after removing Distinct form EnumerableUtils not all the packages were correct rebuilt. Could you please republish the nuget packages?

Best regards
yarick123.

System.Uri Support

Is there a chance we'll ever see direct support for the System.Uri class? Do you foresee any particular difficulties that would be present in creating such support, if I or someone else were to attempt addition of this functionality to the API?

Question: Best way to determine node type?

Hi, I am testing out VirtualFileSystem and I'm really liking it so far.

I'm working on an application, and I need to know before an INode is copied locally (from anywhere else) whether it will save as a file or a folder. Do you know the most reliable way to determine this?

I mean something like the following:

void ProcessData(INode node)
{
// Will the node save as a folder or a file?
// If folder, copy it to local temp folder and process the folder somehow.
// If file, do something else (for example, it may not be supported by this method,)
}

Edit:
I think I may have answered my own question. I guess theNode.NodeType is where you can check if it's a File or Directory. If so, feel free to close this. Thanks.

Disposing Individual Nodes

Is it possible to dispose single nodes instead of the closing an entire file system?

for (var i = 0; i < 100000000; i++)
{
    IFile file = FileSystemManager.Default.ResolveFile(@"C:\file " + i.ToString());
    // TODO: dispose of "file x" only ...
}

// Somewhere else I am working with nodes at the same time, so I can't close the entire file system that they both share.

Running the above example is causing a memory leak. I need a way to dispose of individual nodes. I am still not quite sure how to do this, based on the documentation.

On a side note, this even appears to cause a memory leak.

for (var i = 0; i < 100000000; i++)
{
     IFile file = FileSystemManager.Default.ResolveFile(@"C:\file " + i.ToString());
     FileSystemManager.Default.CloseAllFileSystems();
 }

ReadOnly ZipFileSystem

It looks like the base logic is there, but I don't see any means of ever making the FileSystemOpstions ReadOnly = true.

in FileSystemOptions:
public bool ReadOnly => false;

Shouldn't that at least be marked virtual so I could create my own ZipFIleSystemOptions and then flip that to true?

FileSystemManager.Default.CloseAllFileSystems() does not close all file systems

Dear tumtumtum,

there is the following scenario:

  1. a zip-file is downloaded and is put to a temporary location,
  2. a file thumbnail from this zip-file is copied by VirtualFileSystem to some location:
  var zipFile = FileSystemManager.Default.ResolveFile("zip-file");
...
  var thumbnail = FileSystemManager.Default.ResolveFile(
    string.Format("zip://[{0}]/{1}", zipFile.Address, "thumbnail.jpg"));
 ...
  thumbnail.CopyTo(...);
  1. FileSystemManager.Default.CloseAllFileSystems() is called
  2. the zip-file tried to be deleted. On this place happens an IOException: The process cannot access the file 'zip-file' because it is being used by another process.

A workaround, which helps me, is to insert the following code after processing thumbnail in the finally block:

  thumbnail.FileSystem.Dispose();

P.S. I tried it with current version of VirtualFileSystem - 1.0.0.70.

Best regards
yarick123

Disposing Individual Nodes

It would be nice if you could dispose of nodes individually instead of closing the entire filesystem.

Setting Zip File Compression Level Doesn't Work

I'm trying to set the compression level to "store" (0).

using (ZipFileSystem zfs = ZipFileSystem.CreateZipFile(file, 
FileSystemOptions.Default.AddVariables(new { ZipCompressionLevel = "0" })))
{ ... }

This does not seem to work. It is still compressing the file.

Need Help: Saving/Restoring Attributes

Hi. I'm trying to serialize all attributes from a file/directory (put them into a settings file) and then restore them later.

I need to support all attribute types. Ideally I need to store the attributes as a dictionary, where the key is a string (the attribute name), and the value is a byte array.

I notice theNode.Attributes[...] can have several data types, so how do I make sure they are all byte arrays returned?

Also, somewhat unrelated, but doing this is throwing an exception:

foreach (string name in dir.Attributes.Names)
{
    newDirectory.Attributes[name] = dir.Attributes[name];
}

CopyTo/CopyToDirectory With Directories

This throws a "System.NotSupportedException" :

IDirectory dir = FileSystemManager.Default.ResolveDirectory(@"C:\Users\Name\Documents\Platform Test\A");
IDirectory dir2 = FileSystemManager.Default.ResolveDirectory(@"C:\Users\Name\Documents\Platform Test\B");
dir.CopyToDirectory(dir2, false);

// This does too: dir.CopyTo(dir2, false);

Is CopyToDirectory/CopyTo supported on directories?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.