Works here:
Release 16.04.3 LTS (Xenial Xerus) 64-bit
AMD A4-3400 APU with Radeon(tm) HD Graphics × 2
compile.log has 'sbcl'
--
Remember the file doesn't actually write until you close/flush it or fill the internal buffer.
Ray

                       FriCAS Computer Algebra System
                            Version: FriCAS 1.3.2
                   Timestamp: Tue Apr 25 16:33:05 EDT 2017
-----------------------------------------------------------------------------
   Issue )copyright to view copyright notices.
   Issue )summary for a summary of useful system commands.
   Issue )quit to leave FriCAS and return to shell.
-----------------------------------------------------------------------------


(1) -> q : String := quote()$CHAR

   (1)  """
Type: String
(2) -> f1: TextFile := open("./tmp/foo.txt", "output")

   (2)  "./tmp/foo.txt"
Type: TextFile
(3) -> write!(f1,q);write!(f1,"--Test--");write!(f1,q);

Type: String
(4) -> close! f1

   (4)  "./tmp/foo.txt"
Type: TextFile
(5) -> )quit


rrogers@Mate-desk:~$ less tmp/foo.txt
"--Test--"
tmp/foo.txt (END)

-----------------------------------------------------------------


On 01/27/2018 05:45 AM, Prof. Dr. Johannes Grabmeier FW wrote:
no ideas,
I have 1.3.1. on a MacBook

Am 27.01.18 um 11:40 schrieb 'Nasser M. Abbasi' via FriCAS - computer algebra system:


On Saturday, January 27, 2018 at 4:13:23 AM UTC-6, jg wrote:

    e.g.

    q : String := quote()$CHAR

    write!(f2, q)




Thanks. But it is not working for me. I get error

q : String := quote()$CHAR
f1: TextFile := open("/media/data/tmp/foo.txt", "output")
write!(f1,q)
   >> System error:
UNIX error 71 (EPROTO): Protocol error

I am using

>fricas
viewman not present, disabling graphics
/bin/sh: 1: exec: /home/me/data/fricas/fricas-1.3.2/target/x86_64-linux-gnu/bin/hypertex: not found
Checking for foreign routines
AXIOM="/home/me/data/fricas/fricas-1.3.2/target/x86_64-linux-gnu"
spad-lib="/home/me/data/fricas/fricas-1.3.2/target/x86_64-linux-gnu/lib/libspad.so"
foreign routines found
openServer result 0
                       FriCAS Computer Algebra System
                            Version: FriCAS 1.3.2
                   Timestamp: Mon Jan 22 22:59:20 CST 2018


Linux mint.

    Am 27.01.18 um 10:51 schrieb 'Nasser M. Abbasi' via FriCAS -
    computer algebra system:
    How does one write a single "  to a text file in Fricas?

    I need to write a string to a text file, but also keep the " "
    around the string and
    not have those removed when the string is written. This is
    because later when
    I read the file using another program, I need to have those ""
    there so I can
    read it as string.

    Here is an example

    -------------------------
     f2: TextFile := open("/tmp/foo.txt", "output")
     ii:=integrate(1/(a^2+b^2*x^2), x)
    -------------------------

    Now I want to write variable ii  to the file as string. We see
    it is string when
    doing this

    unparse(ii::InputForm)
    (45)  "atan((b*x)/a)/(a*b)"
                         Type: String

    So I did this

    ----------------------
    (46) -> writeLine!(f2, unparse(ii::InputForm) )
     close!(f2)
    ----------------------

    But when I look at the file, the string quotes that show up on
    the screen "  "
    are missing at the start and at the end in the file

                        atan((b*x)/a)/(a*b)

    So the way I do this in Maple for example, is to add explicit "
    at end and
    at start. But I do not know how to tell fricas to write a single
    ".  I do not
    know how to escape the "

    I tried

            writeLine!(f2, concat("\"", unparse(ii::InputForm), "\"") )

    And tried

            write!(f2, "\"")
            write!(f2,  unparse(ii::InputForm))
            write!(f2, "\"")
            writeLine!(f2)

    But the problem is, I do not know how to write a single "  to
    the file.

    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] <javascript:>.
    To post to this group, send email to [email protected]
    <javascript:>.
    Visit this group at https://groups.google.com/group/fricas-devel
    <https://groups.google.com/group/fricas-devel>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

-- Mit freundlichen Grüßen

    Johannes Grabmeier

    Fraktionsvorsitzender
    FREIE WÄHLER, Stadtrat Deggendorf

    Prof. Dr. Johannes Grabmeier
    Köckstraße 1, D-94469 Deggendorf
    Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
    Fax: +49-(0)-322-241-92688

--
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] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

--
Mit freundlichen Grüßen

Johannes Grabmeier

Fraktionsvorsitzender
FREIE WÄHLER, Stadtrat Deggendorf

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Fax: +49-(0)-322-241-92688
--
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] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

--
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.
  • [fricas-devel] how... 'Nasser M. Abbasi' via FriCAS - computer algebra system
    • Re: [fricas-d... Prof. Dr. Johannes Grabmeier FW
      • Re: [fric... 'Nasser M. Abbasi' via FriCAS - computer algebra system
        • Re: [... Prof. Dr. Johannes Grabmeier FW
          • R... Raymond Rogers
            • ... 'Nasser M. Abbasi' via FriCAS - computer algebra system
              • ... Raymond Rogers
        • Re: [... Waldek Hebisch
          • R... 'Nasser M. Abbasi' via FriCAS - computer algebra system
    • Re: [fricas-d... oldk1331
      • Re: [fric... 'Nasser M. Abbasi' via FriCAS - computer algebra system

Reply via email to