Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

off_t PFile::GetLength (  )  const [virtual, inherited]

Get the current size of the file.

Returns:
length of file in bytes.

Reimplemented in PMemoryFile.

Definition at line 1067 of file pchannel.cxx.

Referenced by Open(), and PFTPServer::SendToClient().

{
#ifdef WOT_NO_FILESYSTEM
  return 0;
#else
  off_t pos = _lseek(GetHandle(), 0, SEEK_CUR);
  off_t len = _lseek(GetHandle(), 0, SEEK_END);
  PAssertOS(_lseek(GetHandle(), pos, SEEK_SET) != (off_t)-1);
  return len;
#endif
}


Generated by  Doxygen 1.6.0   Back to index