[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: how to test if a pipe contains data
From: Christof Warlich <christof () warlich ! name>
Date: 2012-01-24 19:20:35
Message-ID: 4F1F0483.3020907 () warlich ! name
[Download RAW message or body]
Am 24.01.2012 00:36, schrieb Laurent Bercot:
>> I need to transfer data coming from a pipe over a UMTS link to a web server.
>> From time to time, the UMTS link goes down, and worse, it sometimes cannot
>> be reestablished. I believe that in these cases, the firmware of the UMTS stick
>> hangs, but this is just a guess. Anyhow, the only way I could get the link up and
>> running again when this happens is to reboot the whole system.
>>
>> As my application will have tried for quite a while to get the link up
>> before such drastic measures, quite some data may have accumulated in the pipe.
>> To avoid loosing that data, I need to drain the pipe to store its data
>> to a file surviving the recovery. This is the place where I just want to check if
>> there is still data in the pipe. If it is empty, I reboot.
> I must be missing something obvious here. Why don't you just do things
> sequentially ?
>
> cat< namedpipe> savefile ; reboot
>
Consider that the reboot is the exceptional case! The system looks more
something like that:
producer <oldRecoveryData | sender >recoveryData
But don't mind, you guys gave me more helpful ideas I can bear with! :-)
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic