# File Sink Behavior

**URL:** <https://www.ruby-forum.com/t/file-sink-behavior/241887>\
**Category:** GNU Radio\
**Created:** [May 8, 2015, 7:56pm UTC](https://www.ruby-forum.com/t/file-sink-behavior/241887 "2015-05-08T19:56:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 8, 2015, 7:56pm UTC](https://www.ruby-forum.com/t/file-sink-behavior/241887/1 "2015-05-08T19:56:06Z")

</div>

I’m testing a radio by sending known data through from a file source,  
and  
file sinking the data at the end of the Tx/Rx loopback chain. I’m  
getting  
very specific erratic behavior with the contents of the output file. One  
of  
two things happens. First, the output data is perfect. Second, the first  
line of the input file is repeated once, and then the data is perfect  
there  
out. I’ll represent the behavior below:

Line# InputFile.dat OutputFile.dat w/  
Error  
1 Hi how are you Hi how are you  
2 1234567890 Hi how are you  
3 Hi how are you 1234567890  
4 1234567890 Hi how are you  
5 Hi how are you 1234567890  
and so on

When doing BER calculations, this makes the measurement useless, because  
it  
looks like constant errors due to the first line repeat.

I’ve tested this with the File Sink Buffer on and off. It occurs in both  
situations. There is no recognizable pattern to me, sometimes it happens  
and sometimes it doesn’t. Is there a buffer that does not get flushed  
somewhere that could cause this? Has anyone seen this behavior before?

v/r,  
Rich
