int main(int argc, char *argv[])
{
  //  cout  << "argc:" << argc <<endl;

  QString classes = "ALL";

  if (argc!=4)
    usage(argv[0]);
  BottomUp bu(argv[1]); // read infile tnt.uni-hannover.de/

  NodeList *nl = bu.selectClass("ALL");
  qDebug("no elem %d",nl->count());
  if (nl->isEmpty()) return 0;

  Stack stack(nl,argv[2]);
  QString command(argv[3]);

  qDebug("Command=%s",command.latin1());
  stack.registerFunction("neighbour", neighbour);
  if (!stack.run(command)){
    std::cerr << "ga_bu_generic: Error while running stack" << std::endl;
    return EXIT_FAILURE;
  }

  stack.write(argv[2]);
  nl->writeOutImage(QString(argv[2])+".bu.node.plm");
  nl->writeGroupImage(QString(argv[2])+".bu.plm");


}
Exemple #2
0
bool FtpManager::fileExists(const QString &remoteDir, const QString &filename)
{
    if (!_initialized)
        emit requestInitialize();
    if (!_initialized)
        throw FtpException();

    try
    {
        Poco::Timespan time(0, 0, 1, 0, 0);
        std::string dir = (remoteDir + filename).toStdString();
        std::string host = _url.toStdString();
        std::string uname = _user.toStdString();
        std::string password = _password.toStdString();

        Poco::Net::FTPClientSession session(host);
        session.setTimeout(time);
        session.login(uname, password);
        std::istream &is = session.beginList(dir, true);
        std::ostringstream os;
        stream_copy_n(is, 0, os);
        session.endList();
        session.close();
        std::cerr << os.str();
        NodeList dirContents = parseDirectoryContents(os, _isWindows);
        return dirContents->count() > 0;
    }
    catch (Poco::Net::FTPException &ex)
    {
        std::cerr << ex.displayText();
        std::cerr << ex.message();
        if (ex.code() == 550)
        {
            return false;
        }
        throw ex;
    }
    return false;
}