Does now return the correct size if the handle belongs to a real file.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4697 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2003-09-15 22:29:05 +00:00
parent 2430b4ed28
commit 7be68ba5e7

View File

@ -108,16 +108,16 @@ Handle::GetName(char *nameBuffer, size_t bufferSize) const
off_t
Handle::Size() const
{
// ToDo: fix this!
return 1024LL * 1024 * 1024 * 1024;
// 1024 GB
/* struct stat stat;
if (fstat(fHandle, &stat) == B_OK)
struct stat stat;
if (fstat(fHandle, &stat) == B_OK) {
if (stat.st_size == 0) {
// ToDo: fix this!
return 1024LL * 1024 * 1024 * 1024;
// 1024 GB
}
return stat.st_size;
// stat apparently doesn't work with devices
}
return 0LL;
*/
}