Index: cpp/frams/virtfile/stdiofile.h
===================================================================
--- cpp/frams/virtfile/stdiofile.h	(revision 227)
+++ cpp/frams/virtfile/stdiofile.h	(revision 247)
@@ -33,11 +33,11 @@
 StdioFILE(MFILE *f,const SString& p) {file=f;path=p;}
 static void setStdio();
-int Vread(void *ptr, size_t size, size_t nmemb) {return mfread(ptr,size,nmemb,file);}
-int Vwrite(const void *ptr, size_t size, size_t nmemb) {return mfwrite(ptr,size,nmemb,file);}
+size_t Vread(void *ptr, size_t size, size_t nmemb) {return mfread(ptr,size,nmemb,file);}
+size_t Vwrite(const void *ptr, size_t size, size_t nmemb) {return mfwrite(ptr,size,nmemb,file);}
 int Veof() {return mfeof(file);}
 int Vputs(const char *s) {return mfputs(s,file);}
 char *Vgets(char *s, int size) {return mfgets(s,size,file);}
 int Vseek(long offset, int whence) {return mfseek(file,offset,whence);}
-int Vtell() {return mftell(file);}
+long Vtell() {return mftell(file);}
 int Vflush() {return 0;/*NOT IMPLEMENTED!*/;}
 const char* VgetPath() {return path;}
@@ -55,6 +55,6 @@
 StdioFILE(FILE *f,const SString& p) {file=f;path=p;}
 static void setStdio();
-int Vread(void *ptr, size_t size, size_t nmemb) {return fread(ptr,size,nmemb,file);}
-int Vwrite(const void *ptr, size_t size, size_t nmemb) {return fwrite(ptr,size,nmemb,file);}
+size_t Vread(void *ptr, size_t size, size_t nmemb) {return fread(ptr,size,nmemb,file);}
+size_t Vwrite(const void *ptr, size_t size, size_t nmemb) {return fwrite(ptr,size,nmemb,file);}
 int Veof() {return feof(file);}
 int Vputc(int c) {return fputc(c,file);}
@@ -64,5 +64,5 @@
 int Vprintf(const char *format, va_list args) { return vfprintf(file,format,args); }
 int Vseek(long offset, int whence) {return fseek(file,offset,whence);}
-int Vtell() {return ftell(file);}
+long Vtell() {return ftell(file);}
 void Vrewind() {rewind(file);}
 int Vflush() {return fflush(file);}
Index: cpp/frams/virtfile/stringfile.cpp
===================================================================
--- cpp/frams/virtfile/stringfile.cpp	(revision 227)
+++ cpp/frams/virtfile/stringfile.cpp	(revision 247)
@@ -7,10 +7,10 @@
 #include <errno.h> //EINVAL
 
-int StringFILE::Vread(void *ptr, size_t size, size_t nmemb)
+size_t StringFILE::Vread(void *ptr, size_t size, size_t nmemb)
 {
-int have=str.len()-pos;
+int have=(int)(str.len()-pos);
 if (have<=0) return 0;
-int need=size*nmemb;
-if (need>have) {nmemb=have/size; need=size*nmemb;}
+int need=(int)(size*nmemb);
+if (need>have) {nmemb=have/size; need=(int)(size*nmemb);}
 memcpy(ptr,((const char*)str)+pos,need);
 pos+=need;
@@ -23,10 +23,10 @@
 	return EOF;
 else
-	return str[pos++];
+	return str.operator[]((int)pos++);
 }
 
 char *StringFILE::Vgets(char *s, int size)
 {
-int have=str.len()-pos;
+int have=str.len()-(int)pos;
 if (have<=0) return 0;
 if (size<0) size=0;
Index: cpp/frams/virtfile/stringfile.h
===================================================================
--- cpp/frams/virtfile/stringfile.h	(revision 227)
+++ cpp/frams/virtfile/stringfile.h	(revision 247)
@@ -16,13 +16,13 @@
   public:
 StringFILE(SString& s):str(s),pos(0) {}
-int Vread(void *ptr, size_t size, size_t nmemb);
-int Vwrite(const void *ptr, size_t size, size_t nmemb) {str.append((const char*)ptr,size*nmemb); return size*nmemb;}
+size_t Vread(void *ptr, size_t size, size_t nmemb);
+size_t Vwrite(const void *ptr, size_t size, size_t nmemb) {str.append((const char*)ptr,(int)(size*nmemb)); return size*nmemb;}
 int Veof() {return pos>=str.len();}
 int Vputc(int c) {str+=(char)c; return c;}
-int Vputs(const char *s) {str.append(s,strlen(s)); return 0;}
+int Vputs(const char *s) {str.append(s,(int)strlen(s)); return 0;}
 int Vgetc();
 char *Vgets(char *s, int size);
 int Vseek(long offset, int whence);
-int Vtell() {return pos;}
+long Vtell() {return pos;}
 int Vflush() {return 0;}
 };
Index: cpp/frams/virtfile/virtfile.cpp
===================================================================
--- cpp/frams/virtfile/virtfile.cpp	(revision 227)
+++ cpp/frams/virtfile/virtfile.cpp	(revision 247)
@@ -45,4 +45,13 @@
 va_end(argptr);
 return ret;
+}
+
+int VirtFILE::getSize()
+{
+  int saved_pos = Vtell();
+  Vseek(0, SEEK_END);
+  int size = Vtell();
+  Vseek(saved_pos, SEEK_SET);
+  return size;
 }
 
Index: cpp/frams/virtfile/virtfile.h
===================================================================
--- cpp/frams/virtfile/virtfile.h	(revision 227)
+++ cpp/frams/virtfile/virtfile.h	(revision 247)
@@ -23,6 +23,6 @@
 {
   public:
-virtual int Vread(void *ptr, size_t size, size_t nmemb)=0;
-virtual int Vwrite(const void *ptr, size_t size, size_t nmemb)=0;
+virtual size_t Vread(void *ptr, size_t size, size_t nmemb)=0;
+virtual size_t Vwrite(const void *ptr, size_t size, size_t nmemb)=0;
 virtual int Veof()=0;
 virtual int Vputc(int c) {unsigned char data=(unsigned char)c; return (Vwrite(&data,1,1)==1)?data:EOF;}
@@ -30,5 +30,5 @@
 virtual int Vgetc() {unsigned char data; if (Vread(&data,1,1)==1) return data; else return EOF;}
 virtual int Vseek(long offset, int whence)=0;
-virtual int Vtell()=0;
+virtual long Vtell()=0;
 virtual void Vrewind() {Vseek(0,SEEK_SET);}
 virtual int Vflush()=0;
@@ -37,4 +37,5 @@
 int printf(const char *format, ...);
 virtual const char *VgetPath() {return 0;} // 0=unspecified path
+virtual int getSize();
 virtual ~VirtFILE();
 static VirtFILE *Vstdin,*Vstdout,*Vstderr;
