Closed avsm closed 6 years ago
# Bos.OS.Path.symlink ~force:true ~target:Fpath.(v "foo") Fpath.(v "bar") ;; - : (unit, _[> Rresult.R.msg ]) result = Result.Ok () # Bos.OS.Path.symlink ~force:true ~target:Fpath.(v "foo") Fpath.(v "bar") ;; - : (unit, _[> Rresult.R.msg ]) result = Result.Error (`Msg "force symlink foo to bar: No such file or directory") # Bos.OS.Path.symlink ~target:Fpath.(v "foo") Fpath.(v "bar") ;; - : (unit, _[> Rresult.R.msg ]) result = Result.Error (`Msg "symlink foo to bar: File exists")
Unlinking before the symlink call works reliably, but I think the force:true should save this call.
force:true
Mmmh that's odd. Unless I miss something there seem to be some kind of POSIX behaviour divergence here. The second call should return EEXIST and as a far as I can tell this is handled by the code.
EEXIST
The error is in force_remove, here this should be lstat.
force_remove
lstat
Unlinking before the symlink call works reliably, but I think the
force:true
should save this call.