// BamPipe_p.cpp (c) 2011 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
-// Last modified: 10 November 2011 (DB)
+// Last modified: 18 October 2012 (DB)
// ---------------------------------------------------------------------------
// Provides BAM pipe-specific IO behavior
// ***************************************************************************
Close();
// open stdin/stdout depending on requested openmode
+#if defined( SYSTEM_NODEJS ) && SYSTEM_NODEJS == 1
+ if ( mode == IBamIODevice::ReadOnly )
+ m_stream = stdin;
+ else if ( mode == IBamIODevice::WriteOnly )
+ m_stream = stdout;
+#else
if ( mode == IBamIODevice::ReadOnly )
m_stream = freopen(0, "rb", stdin);
else if ( mode == IBamIODevice::WriteOnly )
m_stream = freopen(0, "wb", stdout);
+#endif // SYSTEM_NODEJS
+
else {
const string errorType = string( (mode == IBamIODevice::ReadWrite) ? "unsupported"
: "unknown" );