site  contact  subhomenews

Pburn, Pfind, Pmusic

August 24, 2008 — BarryK
These are all zigbert's applications:

Pburn upgraded to v 2.0.0.

Pfind upgraded to v4.2.

Comments

massive updates
Username: Zigbert
There has become several small bugs, because Puppy 4.1 does not allow redirection to itself. Like this: cat myfile.txt | grep something > myfile.txt I have looked through my code, and updated Pfind, Pfilesearch, Pbackup, Pburn and Pmusic. I would kindly ask you to update one more time. Sorry!!!! Sigmund

Redirection
Username: BarryK
"Zigbert, yes, that is a very old trap for the unwary. You have to redirect to another file first, then you [i]must[/i] have 'sync' if the first line has piping: cat myfile1 | grep something > myfile2 sync mv -f myfile2 myfile1 You can only leave off the 'sync' if piping is not used: grep something myfile1 > myfile2 mv myfile2 myfile1 A way to avoid the sync is this: TEMP1="`cat myfile1 | grep something`" echo "$TEMP1" > myfile2 ...but you sometimes need to be careful that the code within the "``" may be interpreted subtly differently than before -- meaning that it has to be all carefully tested.

let's sync
Username: Zigbert
"Ooookey :) That's why you 'sync' so much. I have not synced when piping, but it still seems to work. When will I meet trouble? And why did it work from Puppy 0.96 until Puppy 4.1 ??? Thanks for the explanation. Sigmund

Re: sync
Username: BarryK
"The problem of redirecting a file into itself has always been there. If it hasn't caused you trouble, you're lucky. Or maybe some unexplained behaviour sometimes now has an explanation. I am not certain if the sync is still needed. I discovered the problem back when we used Busybox Ash, before we had Bash in Puppy. When a line of code in a script has piping, the script may continue to execute the next line before the pipe has fully flushed, thus causing a file to be incorrect. However, maybe Bash does not have this problem? I always play safe and put the sync in.


Tags: puppy