GPII/android — pull request #14 by javihernandez (2013-12-05 09:12:02+00:00)
Title: GPII-458: Remove .tar and .tar.gz files separately

The rm command fails when the .tar.gz file doesn't exist, as a
consequence of this, the .tar file is not being removed. But this is not
the problem, the real one is that the gunzip command doesn't works if
the .tar file exists.

Look at this:

$ ls -l
-rw-rw-r-- root sdcard_rw 0 2013-12-05 10:00 jj
-rw-rw-r-- root sdcard_rw 1536 2013-12-05 10:00 jj.tar
-rw-rw-r-- root sdcard_rw 91 2013-12-05 10:02 jj.tar.gz
$ rm jj.tar.gz
$ ls
jj
jj.tar
$ ls -l
-rw-rw-r-- root sdcard_rw 0 2013-12-05 10:00 jj
-rw-rw-r-- root sdcard_rw 1536 2013-12-05 10:00 jj.tar
$ rm jj.tar.gz jj.tar
rm failed for jj.tar.gz, No such file or directory
$ ls -l
-rw-rw-r-- root sdcard_rw 0 2013-12-05 10:00 jj
-rw-rw-r-- root sdcard_rw 1536 2013-12-05 10:00 jj.tar
$ gzip -c jj.tar > jj.tar.gz
$ ls -l
-rw-rw-r-- root sdcard_rw 0 2013-12-05 10:00 jj
-rw-rw-r-- root sdcard_rw 1536 2013-12-05 10:00 jj.tar
-rw-rw-r-- root sdcard_rw 91 2013-12-05 10:04 jj.tar.gz
$ gunzip jj.tar.gz
gunzip: can't open 'jj.tar': File exists

Cheers,
Javi