|
virtual void | abort (void) |
|
virtual void | close (void) |
|
virtual void | attach (IOFD fd) |
|
virtual void | create (const char *name, bool exclusive=false, int perms=0666) |
|
virtual void | create (const std::string &name, bool exclusive=false, int perms=0666) |
|
| File (void) |
|
| File (IOFD fd, bool autoclose=true) |
|
| File (const char *name, int flags=IOFlags::OpenRead, int perms=0666) |
|
| File (const std::string &name, int flags=IOFlags::OpenRead, int perms=0666) |
|
virtual void | flush (void) |
|
virtual void | open (const char *name, int flags=IOFlags::OpenRead, int perms=0666) |
|
virtual void | open (const std::string &name, int flags=IOFlags::OpenRead, int perms=0666) |
|
virtual IOOffset | position (IOOffset offset, Relative whence=SET) |
|
virtual bool | prefetch (const IOPosBuffer *what, IOSize n) |
|
virtual IOSize | read (void *into, IOSize n) |
|
virtual IOSize | read (void *into, IOSize n, IOOffset pos) |
|
virtual IOSize | readv (IOBuffer *into, IOSize length) |
|
virtual void | resize (IOOffset size) |
|
virtual void | setAutoClose (bool closeit) |
|
virtual IOOffset | size (void) const |
|
virtual IOSize | write (const void *from, IOSize n) |
|
virtual IOSize | write (const void *from, IOSize n, IOOffset pos) |
|
virtual IOSize | writev (const IOBuffer *from, IOSize length) |
|
| ~File (void) |
|
bool | sysclose (IOFD fd, int *error=0) |
|
virtual IOFD | fd (void) const |
|
virtual void | fd (IOFD value) |
|
| IOChannel (IOFD fd=-1) |
|
virtual bool | isBlocking (void) const |
|
virtual void | setBlocking (bool value) |
|
virtual | ~IOChannel (void) |
|
int | read (void) |
|
IOSize | read (IOBuffer into) |
|
IOSize | xread (IOBuffer into) |
|
IOSize | xread (void *into, IOSize n) |
|
IOSize | xreadv (IOBuffer *into, IOSize buffers) |
|
virtual | ~IOInput (void) |
| Destruct the stream. A no-op. More...
|
|
IOSize | write (unsigned char byte) |
|
IOSize | write (IOBuffer from) |
|
IOSize | xwrite (const void *from, IOSize n) |
|
IOSize | xwrite (IOBuffer from) |
|
IOSize | xwritev (const IOBuffer *from, IOSize buffers) |
|
virtual | ~IOOutput (void) |
| Destruct the stream. A no-op. More...
|
|
virtual bool | eof (void) const |
|
virtual IOOffset | position (void) const |
|
IOSize | read (IOBuffer into, IOOffset pos) |
|
virtual IOSize | readv (IOPosBuffer *into, IOSize buffers) |
|
virtual void | rewind (void) |
|
| Storage (void) |
|
IOSize | write (IOBuffer from, IOOffset pos) |
|
virtual IOSize | writev (const IOPosBuffer *from, IOSize buffers) |
|
virtual | ~Storage (void) |
|
Definition at line 7 of file RemoteFile.h.
Storage * RemoteFile::get |
( |
int |
localfd, |
|
|
const std::string & |
name, |
|
|
char ** |
cmd, |
|
|
int |
mode |
|
) |
| |
|
static |
Definition at line 90 of file RemoteFile.cc.
References assert(), close(), join(), IOFlags::OpenCreate, IOFlags::OpenWrite, sysUtil::pid, RemoteFile(), and throwStorageError().
Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), GsiFTPStorageMaker::open(), and HttpStorageMaker::open().
98 int rc = posix_spawnp (&pid,
cmd[0], 0, 0,
cmd, environ);
104 unlink (
name.c_str());
105 throwStorageError (
"RemoteFile",
"Calling RemoteFile::get()",
"posix_spawnp()", errsave);
110 rcpid = waitpid(pid, &rc, 0);
111 while (rcpid == (pid_t) -1 && errno == EINTR);
113 if (rcpid == (pid_t) -1)
117 unlink (
name.c_str());
118 throwStorageError (
"RemoteFile",
"Calling RemoteFile::get()",
"waitpid()", errsave);
121 if (WIFEXITED(rc) && WEXITSTATUS(rc) == 0)
126 unlink (
name.c_str());
129 << (WIFEXITED(rc) ?
" exited with exit code "
130 : WIFSIGNALED(rc) ?
" died from signal "
131 :
" died for an obscure unknown reason with exit status ")
132 << (WIFEXITED(rc) ? WEXITSTATUS(rc)
133 : WIFSIGNALED(rc) ? WTERMSIG(rc)
135 ex.addContext(
"Calling RemoteFile::get()");
void throwStorageError(const char *category, const char *context, const char *call, int error)
RemoteFile(IOFD fd, const std::string &name)
static std::string join(char **cmd)