File: putcommand.cc

package info (click to toggle)
stealth 1.45-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 716 kB
  • ctags: 175
  • sloc: cpp: 1,612; makefile: 88; sh: 70
file content (25 lines) | stat: -rw-r--r-- 471 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "scanner.ih"

string Scanner::putCommand(string const &source, 
                             string const &destination) const
{
    struct stat statbuf;

    if (stat(source.c_str(), &statbuf))
        d_reporter.exit() << "PUT " << source << ": can't stat it" << endl;

    ostringstream command;

    command << d_sorter["DD"] << " of=" << destination << 
                                " bs=1 count=" << statbuf.st_size;

    return command.str();
}