Replaced deprecated filesystem APIs