# [.net] SharpFS (alpha release)

This topic is 4639 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
Usage sample:
//set up file managementFileSystem = new SharpFS.VirtualFS( ".", false, typeof( SharpFS.DirectoryArchiver ), typeof( SharpFS.ZipArchiver ) );FileManager = new SharpFS.FileManager( FileSystem );FileSystem.Mount( "/Textures", "Textures.zip" );//precache some thingsFileManager.Request( "/tree.fx" );FileManager.Request( "/Textures/tree.dds" );FileManager.Request( "/Models/tree.e61" );//get the actual data for the tree textureSystem.IO.MemoryStream stream = FileManager.GetStream( "/Textures/tree.dds" );Texture treeTex = new Texture( device, stream );//if you don't feel like using the manager, direct access is fine tooSharpFS.VirtualFile file = (SharpFS.VirtualFile) FileSystem.OpenFile( "/Textures/tree.dds" );//there's current directory support too (Note: The FileManager does not handle this correctly)FileSystem.CurrentDirectory = "/Textures";SharpFS.VirtualFile file2 = (SharpFS.VirtualFile) FileSystem.OpenFile( "tree.dds" );

[Edited by - Promit on May 7, 2006 2:27:23 PM]

##### Share on other sites
This is great, I was just looking for something like this to be used on one of my projects. Great timing.

One thing I'd like to suggest howerver is the addition of aliases (or shortcuts). For example if you have directory /A/B/C and I simply want to refer to it as abc, then something like:

FileManager.AddAlias( "/A/B/C", "abc" );// then doFileManager.Request( "abc:file.txt" );// instead ofFileManager.Request( "/A/B/C/file.txt" );

I would add it in myself, but I figure if it's a feature you want you can put it in "officially" or something.

##### Share on other sites
I made a semi-major change now, which is that the entire virtual filesystem deals with objects instead of Streams now. This cleans up a few things and more importantly introduces some interesting opportunities for clever things I'm exploring. More to come.

##### Share on other sites
Quote:
 Original post by IFooBarThis is great, I was just looking for something like this to be used on one of my projects. Great timing.One thing I'd like to suggest howerver is the addition of aliases (or shortcuts). For example if you have directory /A/B/C and I simply want to refer to it as abc, then something like:FileManager.AddAlias( "/A/B/C", "abc" );// then doFileManager.Request( "abc:file.txt" );// instead ofFileManager.Request( "/A/B/C/file.txt" );I would add it in myself, but I figure if it's a feature you want you can put it in "officially" or something.

I think it would be cleaner as FileManager.Request( "abc/file.txt" ); that way it would treat the alias as much like a 'real' directory as as possible.

##### Share on other sites
Quote:
 Original post by nagromoI think it would be cleaner as FileManager.Request( "abc/file.txt" ); that way it would treat the alias as much like a 'real' directory as as possible.
Same here, and that's how I'm going to implement it. I just need to work out a few details of exactly how is best to add the support.

##### Share on other sites
I just thought I'd plug Tao.PhysFs (.NET bindings to PhysFS). Its source is available here and will be bundled with the next Tao release.

##### Share on other sites
Quote:
 Original post by Rob LoachI just thought I'd plug <.... and will be bundled with the next...

Rob, while I do appreciate all the Tao work you have done over the years, that was a pretty pants thing to post in this thread.

As to the actual OP. This looks excellent at first glance. Raw maybe, but very promising and nice design so far.

This is something I will be looking to implement within our upcomming project.

##### Share on other sites
Quote:
 Original post by JoviexRob, while I do appreciate all the Tao work you have done over the years, that was a pretty pants thing to post in this thread.
I agree, but it's just that I didn't have the time to give a proper look at SharpFS at the moment. I'll give it a good look at once I have the time.

##### Share on other sites
Ok, aliases work now. Use the VirtualFS.MountAlias function to create them. (And it doesn't check for loops, so for god's sake be careful.) Syntactically they are identical to everything else.

I've done a ton of internal structural work now that makes this thing far more flexible. I'm still exploring exactly how much is possible, but I know for certain that all of the following are doable:
* Mounting HTTP and FTP directories (this is now implemented, see WebArchiver)
* Mounting databases (includes the ability to issue SQL queries to the database!!)
* Object filesystems (a la The Nebula Device)
* Interpreter based object database (see 1 2 3 by Washu)

Washu: All glory to the Washu!

[Edited by - Promit on May 8, 2006 8:33:48 PM]

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634103
• Total Posts
3015539
×