This worked for me on SUSE machine, i shall try this on Ubuntu.
Try attached test program and see if you get the same results.
test.log.zip 410 bytes
I could see the problem only when the path is not correct. You may want first use simple path like file in your home dir to test if it works.
Tons of thanks for pointing out the path issue. Actually I was using ~ for my home directory i.e. instead of :
I was using:
However, upon entering the real complete path, it gave the desired results.