added fileio methods and methods to control wakelocks