On Saturday, January 27, 2018 at 5:27:16 AM UTC-6, oldk1331 wrote:
>
> A few problems:
>
> 1. In FriCAS, the escape char is _ instead of \.
>
> 2. There is no three argument 'concat', you
> need to pass it a list of string.
>
> 3. You should use 'close!' to close the file.
>
> So, basically, write this string instead:
>
> concat ["_"", unparsed(xxx), "_""]
>
>
>
Thanks. Yes, I had [] there in my file for concat, but for some reason when
I typed it here I forgot [].
But I tried the above method. I still get the same protocol error. Here
are the commands
----------------------------------------
(1) -> f1: TextFile := open("/media/data/tmp/foo.txt", "output")
(1) "/media/data/tmp/foo.txt"
Type:
TextFile
(2) -> ii:=integrate(1/(a^2-b^2*x^2), x)
(3) -> write!(f1,concat(["_"", unparse(ii::InputForm), "_""]))
>> System error:
UNIX error 71 (EPROTO): Protocol error
-------------------------------------------
I think I now know why this error shows up.
I am on a Linux VBox, with the disk I am writing to mounted from my Linux
using NTFS file system, since this is a shared disk between Linux VBox and
Windows (the HOST).
When instead I choose a file mounted on the Linux own internal disk, the
error went away:
(4) -> f1: TextFile := open("/home/me/data/foo.txt", "output")
(5) -> ii:=integrate(1/(a^2-b^2*x^2), x)
(6) -> write!(f1,concat(["_"", unparse(ii::InputForm), "_""]))
(6) ""(log(b*x+a)+(-1)*log(b*x+(-1)*a))/(2*a*b)""
Type:
String
(7) -> close!(f1)
No error. And the string was written OK to the file.
I do not think this error should happen when writing from Linux to the
shared disks, as Linux it is supposed to support all IO operations on
mounted shared disk using NTFS. But my be it is the Fricas IO library.
But it is not a big deal. I will instead write to a file on the Linux
virtual
partition from now on instead of on shared disk, then copy the file later.
thanks
--Nasser
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.