Project

General

Profile

Bug #2296

ndngetfile doesn't write anything into the file

Added by Alex Afanasyev over 5 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

Reported on behalf of Diarmuid Collins.


Steps to reproduce:

ndnputfile /tcd/repo/1  /tcd/data/1/ /Users/diarmuidcire/Documents/VIDEO0037.mp4

ndngetfile -o media.mp4 /tcd/data/1

Expected:

  • media.mp4 has content equivalent to /Users/diarmuidcire/Documents/VIDEO0037.mp4

Actual:

  • media.mp4 is empty

Platform:

  • OS X Yosemite
#1

Updated by Alex Afanasyev over 5 years ago

Reported on behalf of Diarmuid Collins.


I believe there is a bug in the ndngetfile.cpp in repo-ng.

The old code was:

std::ofstream of;

if (outputFile != 0)
  {
    of.open(outputFile);
    if (!of)

With the following line - it now will add binary output for the file.

if (outputFile != 0)
  {
    of.open(outputFile, std::ios::out | std::ios::binary | std::ios::trunc);
#2

Updated by Alex Afanasyev over 5 years ago

  • Status changed from New to In Progress
  • Assignee set to Alex Afanasyev
#3

Updated by Alex Afanasyev over 5 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
#4

Updated by Junxiao Shi about 3 years ago

  • Tracker changed from Task to Bug
  • Status changed from Code review to Closed

Also available in: Atom PDF