Within bash this works:
mkfifo afifo
cat small_file > afifo
od -x afifo
#expected contents shown
However, after:
cat small_file > afifo
in a test program which does just this
//len_file is size of small_file
fin = fopen(file_name,"rb");
char *buffer=malloc(len_file);
rlen = fread(buffer, 1, len_file, fin);
the contents of "buffer" is trash. rlen is the same as len_file, and
that number of bytes are written into buffer, but the data seems to have
come from who knows where. It is not the same as was in "small_file".
The test case
was only 36 bytes. Bizarrely if the program is run again, without
sending more data to the fifo, the same (wrong) bytes are read again.
The test works fine on linux.
Also the file_name, passed in on the command line as "afifo", is
converted
to "afifo.lnk". W10 is set to show extensions but the "lnk" is not
visible in a mingw64 shell. In a file explorer window .lnk can be seen
with properties but not in the "details" display.
So, am I doing something wrong or are FIFOs not really a thing in
Mingw64?
(W10, 64 bits.)
Thanks,
David Mathog
mat...@caltech.edu
Manager, Sequence Analysis Facility, Biology Division, Caltech
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public