aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-05-03 08:37:04 +0000
committerTorbjörn Andersson2005-05-03 08:37:04 +0000
commit5f7b3d8cf2bd69b01258b8facdabc9b9de736555 (patch)
treec9db4c4bb34f08b1bcffb081f7a06e23ced1b708
parentf17c35682a2550d212ae1e5dffa9124966f51696 (diff)
downloadscummvm-rg350-5f7b3d8cf2bd69b01258b8facdabc9b9de736555.tar.gz
scummvm-rg350-5f7b3d8cf2bd69b01258b8facdabc9b9de736555.tar.bz2
scummvm-rg350-5f7b3d8cf2bd69b01258b8facdabc9b9de736555.zip
Use File::size() instead of stat() to find the size of a file.
svn-id: r17900
-rw-r--r--gob/dataio.cpp12
-rw-r--r--gob/dataio.h1
2 files changed, 7 insertions, 6 deletions
diff --git a/gob/dataio.cpp b/gob/dataio.cpp
index 84a09c97e7..c01c36083e 100644
--- a/gob/dataio.cpp
+++ b/gob/dataio.cpp
@@ -320,17 +320,20 @@ void data_seekData(int16 handle, int32 pos, int16 from) {
int32 data_getDataSize(const char *name) {
char buf[128];
int32 chunkSz;
- struct stat statBuf;
+ File file;
strcpy(buf, name);
chunkSz = data_getChunkSize(buf);
if (chunkSz >= 0)
return chunkSz;
- if (stat(buf, &statBuf) == -1)
- error("data_getDataSize: Can't find data (%s)", name);
+ if (!file.open(buf))
+ error("data_getDataSize: Can't find data(%s)", name);
- return statBuf.st_size;
+ chunkSz = file.size();
+ file.close();
+
+ return chunkSz;
}
char *data_getData(const char *path) {
@@ -359,7 +362,6 @@ char *data_getData(const char *path) {
data_readData(handle, ptr, size);
data_closeData(handle);
return data;
-
}
char *data_getSmallData(const char *path) {
diff --git a/gob/dataio.h b/gob/dataio.h
index 27efbb006d..d7d5917016 100644
--- a/gob/dataio.h
+++ b/gob/dataio.h
@@ -23,7 +23,6 @@
#define GOB_DATAIO_H
#include "common/file.h"
-#include <sys/stat.h>
namespace Gob {