mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 13:30:36 -04:00
added large file support
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1575 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
70a5cbf107
commit
2597e6a61e
3 changed files with 27 additions and 16 deletions
|
@ -113,7 +113,7 @@ bool ftFileProvider::getFileData(uint64_t offset, uint32_t &chunk_size, void *da
|
|||
/*
|
||||
* seek for base_loc
|
||||
*/
|
||||
fseek(fd, base_loc, SEEK_SET);
|
||||
fseeko64(fd, base_loc, SEEK_SET);
|
||||
|
||||
// Data space allocated by caller.
|
||||
//void *data = malloc(chunk_size);
|
||||
|
@ -191,14 +191,14 @@ int ftFileProvider::initializeFileAttrs()
|
|||
* attempt to open file
|
||||
*/
|
||||
|
||||
fd = fopen(file_name.c_str(), "rb");
|
||||
fd = fopen64(file_name.c_str(), "rb");
|
||||
if (!fd)
|
||||
{
|
||||
std::cerr << "ftFileProvider::initializeFileAttrs() Failed to open (r+b): ";
|
||||
std::cerr << file_name << std::endl;
|
||||
|
||||
/* try opening read only */
|
||||
fd = fopen(file_name.c_str(), "rb");
|
||||
fd = fopen64(file_name.c_str(), "rb");
|
||||
if (!fd)
|
||||
{
|
||||
std::cerr << "ftFileProvider::initializeFileAttrs() Failed to open (rb): ";
|
||||
|
@ -214,13 +214,13 @@ int ftFileProvider::initializeFileAttrs()
|
|||
* move to the end
|
||||
*/
|
||||
|
||||
if (0 != fseek(fd, 0L, SEEK_END))
|
||||
if (0 != fseeko64(fd, 0L, SEEK_END))
|
||||
{
|
||||
std::cerr << "ftFileProvider::initializeFileAttrs() Seek Failed" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t recvdsize = ftell(fd);
|
||||
uint64_t recvdsize = ftello64(fd);
|
||||
|
||||
std::cerr << "ftFileProvider::initializeFileAttrs() File Expected Size: " << mSize << " RecvdSize: " << recvdsize << std::endl;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue