On Mon, Dec 09, 2024 at 07:47:54PM +0100, Grégory Vanuxem wrote:
> Hello,
>
> Thinking about that, and since the TMP or TEMP environment variables
> in Linux contrary to Windows don't exist by default apparently, what
> about creating the temporary files in src/input like some other
> temporary files.
<snip>
> I just checked with just Git cloned FriCAS on MSYS2/MINGW64, all
> files.input checks pass without the use of '/tmp/'.
There are to separate things that we can do:
- 'writable?' is essentially impossible to implement correctly
on modern systems. Namely, the only way to know that file
is writable is to write to it. When it works file is (or
rather was at time of write) writable. So I think that we
should not use 'writable?' for opening files.
- from what you wrote it seems that actial problem is that
'/tmp'/ is not writable from FriCAS. This can be fixed
by creating files in build directory.
I am not sure what you tried, but the attached patch works for
me on Linux and should fix problem on Windows.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/Z1eJnBWD8w5w3O2o%40fricas.org.
diff --git a/src/input/Makefile.in b/src/input/Makefile.in
index ac4c7486..7ffa51b8 100644
--- a/src/input/Makefile.in
+++ b/src/input/Makefile.in
@@ -20,9 +20,8 @@ bugs2008.output: ExportType.spad
regress: regression-tests
mostlyclean-local:
- -rm -f *.output
- -rm -rf *.NRLIB
- -rm -rf $(OUT)
+ -rm -f *.output ts_file.dat
+ -rm -rf *.NRLIB ts_kaf
-rm -f redo.input
-rm -f sieve.asy sieve.lsp simple.asy simple.lsp
-rm -f *.fn *.data *.lib *.$(LISPOBJEXT)
diff --git a/src/input/files.input b/src/input/files.input
index 85cc7cde..a5dd4467 100644
--- a/src/input/files.input
+++ b/src/input/files.input
@@ -18,8 +18,7 @@ a9 := matrix([[1, 2, 3], [-1, 124001, -19]])$I32Matrix
a10 := new(3, 1)$DoubleFloatVector
a11 := matrix([[0, 1], [-1.5, 3.15]])$DoubleFloatMatrix
-)system rm /tmp/ts_file.dat
-f := open("/tmp/ts_file.dat", "output")$File(None)
+f := open("ts_file.dat", "output")$File(None)
write!(f, a1 pretend None)
write!(f, a2 pretend None)
write!(f, a3a pretend None)
@@ -33,8 +32,7 @@ write!(f, a9 pretend None)
write!(f, a10 pretend None)
write!(f, a11 pretend None)
-)system rm -r /tmp/ts_kaf
-kf := open("/tmp/ts_kaf", "output")$KeyedAccessFile(None)
+kf := open("ts_kaf", "output")$KeyedAccessFile(None)
write!(kf, ["a5", a5 pretend None]$Record(key : String, entry : None))
write!(kf, ["a3a", a3a pretend None]$Record(key : String, entry : None))
kf("a3") := a3 pretend None