~ubuntu-branches/debian/experimental/libtorrent/experimental

« back to all changes in this revision

Viewing changes to src/data/file.cc

  • Committer: Bazaar Package Importer
  • Author(s): Qingning Huo
  • Date: 2006-01-12 20:47:33 UTC
  • mto: (4.1.1 edgy) (6.2.1 squeeze) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060112204733-2vw5t3vdne40s8mq
Tags: upstream-0.8.2
ImportĀ upstreamĀ versionĀ 0.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include "config.h"
38
38
 
39
39
#include "file.h"
40
 
#include "file_stat.h"
41
40
#include "torrent/exceptions.h"
42
41
 
43
42
#include <fcntl.h>
44
43
#include <unistd.h>
 
44
#include <rak/file_stat.h>
45
45
#include <sys/ioctl.h>
46
46
#include <sys/mman.h>
47
47
#include <sys/types.h>
127
127
  if (!is_open())
128
128
    throw internal_error("File::size() called on a closed file");
129
129
 
130
 
  return FileStat(m_fd).size();
 
130
  rak::file_stat fs;
 
131
 
 
132
  return fs.update(m_fd) ? fs.size() : 0;
131
133
}  
132
134
 
133
135
bool