[AVFS] Tutorial example - create archive

"Jan Uhlir" <[email protected]> Sun, 13 Mar 2005 17:57:26 +0100
Newsgroups gmane.comp.file-systems.avfs.user
Message-ID <S4039741AbVCMQ50/[email protected]>
I would like to write tutorial example which:
- create archive  (hello.zip)
- create local test file (hello.txt)
- put file inside archive
- read file from archive and print output to stdin

But I get stuck with the first task :(

#include "virtual.h"
...
#define TESTDIR "/tmp/avfstest"
#define TEST_FILE "hello.txt"
#define TEST_ARCHIVE "hello.zip#uzip"

int main(int argc, char *argv[])
{
	int res;
	int fd;

	// create archive
	res = virt_open(TEST_ARCHIVE, O_CREAT, 0666);
	if(res == -1)
		return 0;  // but it still goes here
	else
		// if no error, res contains file descriptor
		fd=res;
...
Should I use virt_mkdir() instead? 
Wrong flags?
Or the path is wrong? Should use something like hello.zip#uzip+?


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click