fix(system): use workspace for temporary files in WriteFile