<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - fstream doesn't play well with named pipes"
href="https://llvm.org/bugs/show_bug.cgi?id=23078">23078</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>fstream doesn't play well with named pipes
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>3.5
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>surfintheusa@yahoo.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Given a pipe created at the command line using 'mkfifo my_pipe' and given the
following snippet:
#include <fstream>
#include <iostream>
#include <string>
int main(int, char*[])
{
std::fstream pipe("my_pipe");
std::string message;
while(std::getline(pipe, message) && message != "EXIT")
{
std::cout << message << std::endl
}
return 0;
}
If I run the program and (from another command prompt) issue the command "echo
banana > my_pipe", nothing gets printed as it appears the call to getline never
returns. The same snippet and scenario with libstdc++ 4.7.2 works as expected.
That is getline returns, cout prints the message and we loop until message is
"EXIT".
MacOS X 10.10.2
clang -v:
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>