From: Dejan L. <dlo...@us...> - 2004-06-13 17:25:58
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14688 Modified Files: File.cpp Log Message: Added GetSize() Index: File.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/File.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** File.cpp 13 Jun 2004 10:38:33 -0000 1.7 --- File.cpp 13 Jun 2004 17:25:50 -0000 1.8 *************** *** 52,55 **** --- 52,56 ---- #include <unistd.h> #include <sys/file.h> + #include <stat.h> namespace Rtk *************** *** 228,232 **** int File::Close() { ! int ret; // return value if (_flags & EXTERN_HANDLE) ERROR_RETURN(CANNOT_CLOSE_EXTERNAL); --- 229,233 ---- int File::Close() { ! int ret; // return value if (_flags & EXTERN_HANDLE) ERROR_RETURN(CANNOT_CLOSE_EXTERNAL); *************** *** 325,327 **** --- 326,343 ---- }; // Rtk + long File::GetSize() + { + const RCHAR *file = _filename.c_str(); + const char *afile = NULL; + struct stat file_size; + #ifdef UNICODE + W2A(file, afile); + if(afile==NULL) ERROR_RETURN(OPERATION_FAILED); + #else + afile = file; + #endif + stat(afile,&file_size); + return (long) file_size.st_size; + + } |