~ubuntu-branches/ubuntu/trusty/nordugrid-arc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/clients/compute/arcget.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2013-05-08 13:48:03 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20130508134803-mrhc5w4d5y7ubyj4
Tags: 3.0.1-1
3.0.1 Release

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#include <config.h>
5
5
#endif
6
6
 
 
7
#include <sys/stat.h>
7
8
#include <iostream>
8
9
#include <list>
9
10
#include <string>
12
13
#include <arc/IString.h>
13
14
#include <arc/Logger.h>
14
15
#include <arc/UserConfig.h>
 
16
#include <arc/FileUtils.h>
15
17
#include <arc/compute/JobInformationStorage.h>
16
18
#include <arc/compute/JobSupervisor.h>
17
19
 
130
132
    return 1;
131
133
  }
132
134
 
 
135
  if(!opt.downloaddir.empty()) {
 
136
    Arc::URL dirpath(opt.downloaddir);
 
137
    if(dirpath.Protocol() == "file") {
 
138
      if(!Arc::DirCreate(dirpath.Path(),S_IRWXU,true)) {
 
139
        std::string errstr = Arc::StrError();
 
140
        logger.msg(Arc::ERROR, "Unable to create directory for storing results (%s) - %s", dirpath.Path(), errstr);
 
141
        return 1;
 
142
      }
 
143
    }
 
144
  }
133
145
  std::list<std::string> downloaddirectories;
134
146
  int retval = (int)!jobmaster.Retrieve(opt.downloaddir, opt.usejobname, opt.forcedownload, downloaddirectories);
135
147