Author: post
Date: 2010-11-30 22:02:38 +0100 (Tue, 30 Nov 2010)
New Revision: 309
Modified:
RawSpeed/FileReader.cpp
Log:
Possible fix for reading file size on cifs shares.
Modified: RawSpeed/FileReader.cpp
===================================================================
--- RawSpeed/FileReader.cpp 2010-11-28 16:04:40 UTC (rev 308)
+++ RawSpeed/FileReader.cpp 2010-11-30 21:02:38 UTC (rev 309)
@@ -41,14 +41,14 @@
int fd;
char *dest;
- if (stat(mFilename, &st) < 0)
+ fd = open(mFilename, O_RDONLY);
+ if (fd < 0)
+ throw FileIOException("Could not open file.");
+ if (fstat(fd, &st) < 0)
throw FileIOException("Could not read size of file (check
permissions)");
if (st.st_size == 0)
throw FileIOException("File is 0 bytes.");
- fd = open(mFilename, O_RDONLY);
- if (fd < 0)
- throw FileIOException("Could not open file.");
#if 0
// Not used, as it is slower than sync read
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit