Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact


Moderators: larsivi kris

Posted: 08/19/07 15:55:57

Hello everyone.

I have some questions concerning package. I couldn't find a better place to post, so here it goes.

What are design goals of VFS in tango? What is this supposed to be used for? I'm asking because I only see it applicable to computer games. :)

I think that I could contribute to VFS if I understand what is it for correctly. For example, zip archives could be mounted as read-only folders. Folders could be granted either read, write or read and write access rights (right now, there seems to be only one writable mountpoint), etc.

Best regards, Linker

Author Message

Posted: 08/23/07 17:42:00 -- Modified: 08/23/07 17:44:21 by

It looks like no-one is interested in this, or everyone is just plain busy.

Best regards.

Posted: 08/24/07 05:45:10

We're in the middle of the D conference, so please have some patience :)

Posted: 08/25/07 07:42:53

Larsivi is the best resource to discuss this with, and he'll be traveling until Monday or Tuesday. Hold on for a couple of days?

Posted: 08/27/07 16:44:52

I think I'm patient enough. So let the discussion begin. :)

I've been thinking of adding functionality to handle archives (ZIPs for the moment) to tango, and making sure that this support is transparent (like, invisible to end-user). Entire directory trees could be collapsed to archives (well, for gaming purposes, this is a very nice property). This is what I'm up with currently:

interface IPack {
	// returns name of the pack file (this is the actual archive file name)
	PathView name();
	// open file in the pack file with the provided style
	IConduit open( char[] filename, FileConduit.Style style );

// this conduit is used to marshal data in and out of ZipFile
final class ZipConduit : Conduit {
	private this();	// TODO: params

	uint bufferSize();
	Handle fileHandle();
	uint read( void[] dst );
	uint write( void[] src );
	override void close();

	private {
		ZipFile			parent;
		FileConduit.Style	style;
		// TODO: checksum calculator
		// TODO: compressor/decompressor
		// TODO: temp buffer for in-place compression/decompression

// this buffer encodes/decodes data you pass to it
final class ZipFile : IPack {
	// create new archive

	// open existing archive for reading, writing or appending
	this( char[] filename );
	this( PathView filename );

	PathView name() {
		return path;

	// returns ZipConduit
	IConduit open( char[] filename, FileConduit.Style style );

	private {
		PathView		path;
		FileConduit		fc;			// file conduit

		// TODO: archive entry table
		// TODO: list of active ZipConduits

// this class implements a stream filter for writing/reading compressed
// data in GZIP format
final class GZipFile : Conduit {
	uint bufferSize();
	Handle fileHandle();
	uint read( void[] dst );
	uint write( void[] src );
	override void close();

	private {
		// TODO: CRC-32 calculator
		// TODO: temp buffer for in-place compression/decompression

What do you think on this? I might be wrong at understanding basic tango io concepts.

There are lots of issues I can see, oh well.. I would surely use some advice/help. :)

Posted: 09/03/07 20:32:23

Sorry for being late in answering this, very much has been going on lately.

Virtual file systems are very popular in game systems, if only because they tend to need media stored in different places, and different levels of reach (hard drive, cd-roms, zip-files, etc), but they certainly are useful in other situations, because they abstract away some of the complexity related to different variations of file systems. They can even make some data appear as file systems even when they are not.

The goal of ?

To create a base interface for that makes for easily accessible file systems, and to be fairly easy to extend to those that won't go into the main Tango VFS.

Zipfiles are such an obvious and useful direction for a VFS, so that will go in. The base for this part, is the Bzip2 and Zlib stream filters already added to Tango svn. An archive file will be represented as a Folder that can be mounted in the VFS. Note that for most cases, this is a much better to represent a Zip-file, due to how it is created. Making it a stream as you do when inheriting Conduit, only complicates matters, as an archive often is a collection of independently compressed entries, with metadata before, after or in between.

The current is a good measure of how the interfaces are meant to cooperate, although they are likely to change somewhat before the next release. There is a branch under my nick that will contain VFS progress before it is merged back in trunk.

Hope this answers some of your questions :) Feel free to pick on particular points. I can put a note in this thread when I believe the interfaces have solidified, in case you want to contribute :)

Posted: 09/15/07 18:07:39

Thanks for your answer!

Please leave a note here when interfaces get solidified so I can contribute. :)


Posted: 09/15/07 18:14:20

Dima-san wrote:

Thanks for your answer!

Please leave a note here when interfaces get solidified so I can contribute. :)


Damn I forgot to log-out again!


Posted: 09/20/07 17:53:42

don't forget the network connections

gnome has a nice vfs.

you can also mount the results of a file search using it which is pretty nifty.

the gnome vfs also forms the interface to the users desktop, so the icons and shortcuts are available by opening a directory some thing like:


I forget the exact syntax, but it's definitely the way to go.

Posted: 09/20/07 21:41:55

Network connections? As in mounting networked resources?

Not sure I'm forgetting anything, but I may not know about everything ;)