MCPcopy Create free account
hub / github.com/THUNLP-MT/MEAN / fopen

Method fopen

evaluation/TMscore.cpp:2403–2430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2401 */
2402 template <typename C, typename T>
2403 std::size_t
2404 basic_pstreambuf<C,T>::fopen(FILE*& in, FILE*& out, FILE*& err)
2405 {
2406 in = out = err = NULL;
2407 std::size_t open_files = 0;
2408 if (wpipe() > -1)
2409 {
2410 if ((in = ::fdopen(wpipe(), "w")))
2411 {
2412 open_files |= pstdin;
2413 }
2414 }
2415 if (rpipe(rsrc_out) > -1)
2416 {
2417 if ((out = ::fdopen(rpipe(rsrc_out), "r")))
2418 {
2419 open_files |= pstdout;
2420 }
2421 }
2422 if (rpipe(rsrc_err) > -1)
2423 {
2424 if ((err = ::fdopen(rpipe(rsrc_err), "r")))
2425 {
2426 open_files |= pstderr;
2427 }
2428 }
2429 return open_files;
2430 }
2431
2432 /**
2433 * @warning This function exposes the internals of the stream buffer and

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected