Beispiel #1
0
void goodbye(void)
{
	string str;
	SerializedConsoleOutput sco("", "", "", "");
	sco.writeToString(&str);
	std::cout << str;
	std::cout.flush();
}
Beispiel #2
0
void gotsig(int signo)
{
	string str = strsignal(signo);
	str += "\n";
	SerializedConsoleOutput sco("", str, "", "");
	sco.writeToString(&str);
	std::cout << str;
	std::cout.flush();
	exit(-1);
}
Beispiel #3
0
void SerializedOutputConsole::process(const char *line)
{
	_ss_out.str("");
	_ss_err.str("");
	StreamInterceptor iout(&stdout, _tmp_out);
	StreamInterceptor ierr(&stderr, _tmp_err);
	_console->process(line);
	iout.getInterceptedOutput(_ss_out);
	ierr.getInterceptedOutput(_ss_err);
	string str;
	SerializedConsoleOutput sco(_ss_out.str(),
	                            _ss_err.str(),
	                            _console->prompt(),
	                            _console->input());
	sco.writeToString(&str);
	std::cout << str;
	std::cout.flush();
}
void
SCOCacheMountPoint::scanNamespace(SCOCacheNamespace* nspace)
{
    VERIFY(initialised_);

    const fs::path p(path_ / nspace->getName().str());

    LOG_DEBUG(path_ << ": scanning mountpoint for namespace " <<
              nspace->getName() << "( " << p << ")");

    THROW_UNLESS(hasNamespace(nspace->getName()));

    fs::directory_iterator end;

    for (fs::directory_iterator it(p); it != end; ++it)
    {
       if (!fs::is_regular_file(it->status()))
       {
           LOG_WARN("ignoring non-file entry " << it->path());
           continue;
       }

       const std::string fname(it->path().filename().string());
       if (!SCO::isSCOString(fname))
       {
           LOG_WARN("ignoring non-SCO entry " << it->path());
           continue;
       }

       SCO scoName(fname);

       LOG_DEBUG(path_ << ": found SCO " << fname << " in " << p);

       CachedSCOPtr sco(new CachedSCO(nspace,
                                      scoName,
                                      this,
                                      it->path()));

       scoCache_.insertScannedSCO(sco);
   }

    LOG_DEBUG(path_ << ": namespace " << nspace->getName() << " scanned");
}