From a5c9ce9306e4c6420a9fb89600a97b68df859857 Mon Sep 17 00:00:00 2001 From: Edwin Brady Date: Sun, 24 May 2020 20:29:49 +0100 Subject: [PATCH] Some directory file function renamings This allows us to build Idris2 proper again --- config.mk | 2 +- libs/base/System/Directory.idr | 8 ++++---- libs/base/System/File.idr | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.mk b/config.mk index 417c0c1..dcbfe15 100644 --- a/config.mk +++ b/config.mk @@ -1,6 +1,6 @@ ##### Options which a user might set before building go here ##### -PREFIX ?= $(HOME)/.idris2 +PREFIX ?= $(HOME)/.idris2boot # Add any optimisation/profiling flags for C here (e.g. -O2) OPT = diff --git a/libs/base/System/Directory.idr b/libs/base/System/Directory.idr index a722e65..d3bdc59 100644 --- a/libs/base/System/Directory.idr +++ b/libs/base/System/Directory.idr @@ -71,16 +71,16 @@ currentDir else pure (Just (prim__getString res)) export -dirOpen : String -> IO (Either FileError Directory) -dirOpen d +openDir : String -> IO (Either FileError Directory) +openDir d = do res <- primIO (prim_openDir d) if prim__nullAnyPtr res /= 0 then returnError else ok (MkDir res) export -dirClose : Directory -> IO () -dirClose (MkDir d) = primIO (prim_closeDir d) +closeDir : Directory -> IO () +closeDir (MkDir d) = primIO (prim_closeDir d) export dirEntry : Directory -> IO (Either FileError String) diff --git a/libs/base/System/File.idr b/libs/base/System/File.idr index 1972e4c..f4ac5ad 100644 --- a/libs/base/System/File.idr +++ b/libs/base/System/File.idr @@ -210,8 +210,8 @@ fileStatusTime (FHandle f) else returnError export -fileRemove : String -> IO (Either FileError ()) -fileRemove fname +removeFile : String -> IO (Either FileError ()) +removeFile fname = do res <- primIO (prim__fileRemove fname) if res == 0 then ok ()