From a274f9943760cd6c72a38ffa59c0ca605f3bc09a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 12 Aug 2018 21:12:58 -0500 Subject: [PATCH] io.files.temp: When using temp-file, it's possible that it fails since the temporary-directory does not exist yet. Always check if the directory exists and create it if not. --- basis/io/files/temp/temp.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/basis/io/files/temp/temp.factor b/basis/io/files/temp/temp.factor index b1c18725c1..477c1f078d 100644 --- a/basis/io/files/temp/temp.factor +++ b/basis/io/files/temp/temp.factor @@ -12,7 +12,8 @@ SYMBOL: current-temp-directory current-temp-directory get ; : temp-file ( name -- path ) - temp-directory prepend-path ; + temp-directory + [ make-directories ] [ prepend-path ] bi ; : with-temp-directory ( quot -- ) [ temp-directory ] dip with-directory ; inline