~ubuntu-branches/debian/sid/upx-ucl/sid

« back to all changes in this revision

Viewing changes to src/file.cpp

  • Committer: Package Import Robot
  • Author(s): Robert Luberda
  • Date: 2013-05-10 09:18:12 UTC
  • mfrom: (5.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130510091812-l0xhxajjny9s0d8p
Tags: 3.09-2
* Upload to unstable.
* Standard-Version: 3.9.4:
  + add Built-Using field referring to version of lzma-dev package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
   This file is part of the UPX executable compressor.
4
4
 
5
 
   Copyright (C) 1996-2011 Markus Franz Xaver Johannes Oberhumer
6
 
   Copyright (C) 1996-2011 Laszlo Molnar
 
5
   Copyright (C) 1996-2013 Markus Franz Xaver Johannes Oberhumer
 
6
   Copyright (C) 1996-2013 Laszlo Molnar
7
7
   All Rights Reserved.
8
8
 
9
9
   UPX and the UCL library are free software; you can redistribute them
410
410
    super::seek(off,whence);
411
411
}
412
412
 
413
 
int OutputFile::read(void *buf, int len)
414
 
{
415
 
    InputFile infile;
416
 
    infile.open(this->getName(), O_RDONLY);
417
 
    infile.seek(this->tell(), SEEK_SET);
418
 
    return infile.read(buf, len);
419
 
}
420
 
 
421
 
int OutputFile::readx(void *buf, int len)
422
 
{
423
 
    InputFile infile;
424
 
    infile.open(this->getName(), O_RDONLY);
425
 
    infile.seek(this->tell(), SEEK_SET);
426
 
    return infile.readx(buf, len);
427
 
}
 
413
// WARNING: fsync() does not exist in some Windows environments.
 
414
// This trick works only on UNIX-like systems.
 
415
//int OutputFile::read(void *buf, int len)
 
416
//{
 
417
//    fsync(_fd);
 
418
//    InputFile infile;
 
419
//    infile.open(this->getName(), O_RDONLY);
 
420
//    infile.seek(this->tell(), SEEK_SET);
 
421
//    return infile.read(buf, len);
 
422
//}
428
423
 
429
424
void OutputFile::set_extent(off_t offset, off_t length)
430
425
{