Bug fix: Changed the range for chmod.
         * Since os.chmod takes the number given as oct number
	   It doesn't behave the same way as shell.
         * Now it takes random value between 0 and 511 in oct,
	   in decimal it would be 0 to 777.

Signed-off-by: Vijaykumar Koppad <vijaykumar.koppad@gmail.com>
Fixed logging for truncate option.

Signe-off-by: Vijaykumar Koppad <vijaykumar.koppad@gmail.com>