dCore Import Debian Packages to Mountable SCE extensions > dCore X86

Empty '.filetool.lst'

<< < (6/6)

Rich:
Hi Jason W
In that case, maybe approach it from the other direction and test for the existence of characters. Maybe something like:

--- Code: ---busybox grep -c  '[a-zA-Z]' /opt/.filetool.lst
--- End code ---

gerald_clark:
WORDS=$(wc /opt/.filetool.lst | awk '{ print $2 }')

sm8ps:
Jason, I suppose you have taken a closer look at the code. At this occasion, I would like to mention the following difference between the graphical logout/backup tool and the console command backup.
The graphical tool spits out an error message for an empty '.filetool.lst', referring to '/tmp/backup_status'. However, the console command finishes silently in the very same situation.
I suggest including the same tests to the console command as the graphical logout/backup tool supposedly runs.

That said, I still support the idea of checking for an empty '.filetool.lst', seen that others seem to be interested as well. Thanks to Rich and gerald_clark for the specific suggestions! My work-around with a dummy file seems rather clumsy.
Combining the logic you outlined on May 9th (http://forum.tinycorelinux.net/index.php/topic,18393.msg112162.html#msg112162) with counting words sound good to me.

Jason W:
Uploaded to release.  Simply creates /opt/.filetool.lst if not existing, if blank or no text then echoes it's own entry as to prevent error.

The existing options for backup already create enough safety in dealing with the backup routine other than the blank or non existing /opt/.filetool.lst.

Navigation

[0] Message Index

[*] Previous page

Go to full version