Based on graceful-fs for more stable file operations.