<div dir="ltr">Sorry my description wasn&#39;t clear.  The link created is a hard link; I thought this is a fairly common pattern of writing data to disk for unix systems.<div><br></div><div>The most concise way to precisely convey what&#39;s happening may be with some trace exerts:</div><div><br></div><div>Expected:</div><div><p class=""><span class="">open(&quot;main.pre.tsidx&quot;, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3</span></p><p class=""><span class="">write(3, &quot;\33[?1049h\33[?1h\33=\33[1;61r\33[?12;25h\33&quot;..., 29549) = 29549</span></p><p class=""><span class="">close(3)                                = 0</span></p><p class=""><span class="">link(&quot;main.pre.tsidx&quot;, &quot;main.tsidx&quot;)    = 0</span></p><p class=""><span class="">unlink(&quot;main.pre.tsidx&quot;)                = 0</span></p><p class=""></p><p class=""><span class="">stat(&quot;main.tsidx&quot;, {st_mode=S_IFREG|0600, st_size=29549, ...}) = 0</span></p><p class=""><span class=""><br></span></p><p class=""><span class="">So we write 29549 bytes to main.pre.tsidx so we would expect main.tsidx to have a size of 29549 bytes and in this example it does (the st_size in the stat).</span></p><p class=""><br></p><p class="">If we iterate over that process thousands to millions of times, we&#39;ll see the following happen:</p><p class=""><span class="">open(&quot;main.pre.tsidx&quot;, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3</span></p><p class=""><span class="">write(3, &quot;\33[?1049h\33[?1h\33=\33[1;61r\33[?12;25h\33&quot;..., 29549) = 29549</span></p><p class=""><span class="">close(3)                                = 0</span></p><p class=""><span class="">link(&quot;main.pre.tsidx&quot;, &quot;main.tsidx&quot;)    = 0</span></p><p class=""><span class="">unlink(&quot;main.pre.tsidx&quot;)                = 0</span></p><p class=""></p><p class=""><span class="">stat(&quot;main.tsidx&quot;, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0</span></p><p class=""><br></p><p class="">In this case, we would expect main.tsidx to have a size of 29549 bytes, but it has a size of 0</p><p class="">The actual application is a proprietary application; its a niche product, but its run by a number of companies in town.  The pastebin in the first e-mail (<a href="http://pastebin.com/mFmZzYEL">http://pastebin.com/mFmZzYEL</a>) has the a trace excerpt it from the actual application. <br></p><p class="">The above examples are from tracing the C program I wrote to isolate this problem (<a href="https://gist.github.com/w3ttr3y/167b349d2ab67e3aa9d2">https://gist.github.com/w3ttr3y/167b349d2ab67e3aa9d2</a>  it is ugly and probably missing some checks to ensure things suceeded, so I&#39;d only trust it if you trace it and then verify everything suceeded in the trace);  </p><p class="">The big difference between the proprietary application and my demo is the real one uses explicit paths instead of relative; both files are in the same directory though so crossing a partition boundary isn&#39;t an issue</p><p class="">I didn&#39;t explicitly answer your questions, question by question. I started to, but I started thinking of all sorts of ambiguities so I hoped trace excerpts would more concisely document what is happening.</p><p class="">I really appreciate you taking the time to try and help me,</p><p class="">--Bill</p></div></div>