rpipe | Neuroimaging preprocessing pipeline , the ruby way | Data Labeling library
kandi X-RAY | rpipe Summary
kandi X-RAY | rpipe Summary
Neuroimaging preprocessing pipeline, the ruby way
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Recursively converts sequence into a sequence .
- Iterate over the sequences in the sequence .
- Generate a scan .
- Strip the files in the specified volume
- Loads the name of a file in a file .
- Recursively reconstruct the contents of a file
- Search for files
rpipe Key Features
rpipe Examples and Code Snippets
Community Discussions
Trending Discussions on rpipe
QUESTION
I just read some Go code that does something along the following lines:
...ANSWER
Answered 2021-Apr-03 at 19:03That code is typical of a program that wants to read output generated by some other program. The os.Pipe()
function returns a connected pair of os.File
entities (or, on error—which should not be simply ignored—doesn't) where a write on the second (w
or wpipe
) entity shows up as readable bytes on the first (r
/ rpipe
) entity. But—this is the key to half the answer to your first question—how will a reader know when all writers are finished writing?
For a reader to get an EOF indication, all writers that have or had access to the write side of the pipe must call the close
operation. By passing the write side of the pipe to a program that we start with cmd.Start()
, we allow that command to access the write side of the pipe. When that command closes that pipe, one of the entities with access has closed the pipe. But another entity with access hasn't closed it yet: we have write access.
To see an EOF, then, we must close off access to our wpipe
, with wpipe.Close()
. So that answer the first half of:
- Why is
inst.wpipe
closed and set to nil?
The set-to-nil
part may or may not have any function; you should inspect the rest of the code to find out if it does.
- Is
dup2(pipe_fd[1], 1)
the C analogue ofcmd.Stdout = inst.wpipe; inst.wpipe.Close()?
Not precisely. The dup2
level is down in the POSIX OS area, while cmd.Stdout
is at a higher (OS-independent) level. The POSIX implementation of cmd.Start()
will wind up calling dup2
(or something equivalent) like this after calling fork
(or something equivalent). The POSIX equivalent of inst.wipe.Close()
is close(wfd)
where wfd
is the POSIX file number in wpipe
.
In C code that doesn't have any higher level wrapping around it, we'd have something like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rpipe
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page