#include <v_lib.h>

int main()
{
	vhandle_t out;
	char out_name[]="//g/1/2/3/out/file.txt";
	char drive[_MAX_DRIVE],dir[_MAX_DIR],name[_MAX_FNAME],ext[_MAX_EXT];
	
	logUpperLevel(LOG_TRACE);
	logStartConsoleLog();
	fsInit(NULL);
	
	fsSplitPath(out_name,drive,dir,name,ext);
	printf("drive\t%s\ndir\t%s\nname\t%s\next\t%s\n",drive,dir,name,ext);

#ifndef	__UNIX__	

	out=fileOpenWrite(out_name);
	if(out)
	{
		filePrintf(out,"Hello, ");
		fileClose(out);
	}

	out=fileOpenAppend("//g/1/2/3/out/file.txt");
	if(out)
	{
		filePrintf(out," World !\n\n");
		fileClose(out);
	}
	
	/* will fail - 'permission denied' */
	out=fileOpenWrite("//c/winnt/dump.txt");
	if(out)
	{
		filePrintf(out,"dump");
		fileClose(out);
	}

#else

	out=fileOpenWrite("/home/vladimir/src/test/out/file.txt");
	if(out)
	{
		filePrintf(out,"Hello, ");
		fileClose(out);
	}

	out=fileOpenAppend("/home/vladimir/src/test/out/file.txt");
	if(out)
	{
		filePrintf(out,"World !\n");
		fileClose(out);
	}

#endif /* __UNIX__ */

	fsShutdown();
	return 0;
}
