Tried to use stat() to get the size of the file, but of course, that don't

work out for devices - still need to fix it.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4644 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2003-09-12 07:12:55 +00:00
parent 3f2188ad1a
commit 4e91b25740
+9
View File
@@ -81,6 +81,7 @@ Handle::SetTo(int handle, bool takeOwnership)
ssize_t
Handle::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
{
//printf("Handle::ReadAt(pos = %Ld, buffer = %p, size = %lu)\n", pos, buffer, bufferSize);
return read_pos(fHandle, pos, buffer, bufferSize);
}
@@ -110,5 +111,13 @@ Handle::Size() const
// ToDo: fix this!
return 1024LL * 1024 * 1024 * 1024;
// 1024 GB
/* struct stat stat;
if (fstat(fHandle, &stat) == B_OK)
return stat.st_size;
// stat apparently doesn't work with devices
return 0LL;
*/
}