hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 432397f6a0a91ee620be3dc0cdf0f9e7a3b8ee37
parent 27819061e96edf1ad19a4267127f16bcf9e901e5
Author: Drew DeVault <sir@cmpwn.com>
Date:   Tue, 22 Jun 2021 14:38:19 -0400

fs::move: use is_file instead of bitbanging mode

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mfs/fs.ha | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/fs.ha b/fs/fs.ha @@ -68,8 +68,7 @@ export fn move(fs: *fs, oldpath: str, newpath: str) (void | error) = { // - If an error occurs, remove the new file. // - Move non-regular files let st = fs::stat(fs, oldpath)?; - assert(st.mode & mode::REG == mode::REG, - "TODO: move non-regular files"); + assert(is_file(st.mode), "TODO: move non-regular files"); let new = fs::create(fs, newpath, st.mode)?; defer io::close(new); let old = fs::open(fs, oldpath)?;