File: write.cc

package info (click to toggle)
stealth 3.00.00-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,380 kB
  • ctags: 371
  • sloc: cpp: 2,730; makefile: 161; sh: 98
file content (12 lines) | stat: -rw-r--r-- 494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
#include "ipc.ih"

void IPC::write(string const &msg) const
{
    fstream runFile(d_options.runFile(), ios::in | ios::out);

    runFile.ignore(numeric_limits<int>::max(), '\n');   // skip one line
    runFile.seekp(0, ios::cur);                         // prepare for writing
    runFile << msg << '\n' <<                           // write the msg
                getpid() << '\n';                       // write our own pid
    runFile.close();                                    // done.
}