I am writing a middleware application for Android Gingerbread.
Somewhere in my code, there is a line,
printf("--Executing command\n");
if (system ("rm -f /tmp/dump.txt")){}
printf("file deletion successful\n");
I get the prints till line, --Executing command
, then it hangs.
When I did ps
, I can see sh -c rm -f /tmp/dump.txt
. The process is still there. Why my code is not moving past the system
call or Why the system call hanged, as seen in the ps
?
If there had been permission problems, I would have got an error.
EDIT
The call if (system ("rm -f /tmp/dump.txt")){}
is actually deleting the file, as I verified through ls /tmp/
file is removed, but then its not coming out. It hangs.
EDIT
On searching few more, I found this. Can there be a similar issue? I am using Android Gingerbread, which is way too old.