// 순진한 버전 — ?로 짧게 쓴 것. // // 이 파일의 목적은 통과하는 것이 아니라, 통과한다는 사실을 보여주는 것이다. import "../std-draft/fs" as Fs import "cool.dev/std/string" as String pub fn update(fs: Fs.Fs, path: String, contents: String) effects {Fs.create, Fs.write, Fs.sync, Fs.close, Fs.rename} -> Result[Unit, Fs.IoError] { let tmp = String.concat(path, ".tmp") let f = fs.create(tmp)? fs.write(f, contents)? fs.sync(f)? fs.close(f)? fs.rename(tmp, path)? Ok(unit) }