Loading ...
Sorry, an error occurred while loading the content.

[sw-gis] write to output file

Expand Messages
  • Joseph Stain
    Hi: I want to write to output file (external file). I did the following: Magik2 s
    Message 1 of 4 , Mar 2, 1999
    View Source
    • 0 Attachment
      Hi:

      I want to write to output file (external file).

      I did the following:
      Magik2> s << external_text_output_stream.new("d:\test15.txt")
      an external_text_output_stream
      Magik2> s.write("this is a test")

      This only create the file "d:\test15.txt", but not wrote the text "this
      is a test".

      Thanks in advance !!!



      ______________________________________________________

      ------------------------------------------------------------------------
      eGroup home: http://www.eGroups.com/list/sw-gis
      Free Web-based e-mail groups by eGroups.com
    • OEDEWALDT, KYLE K
      Try this: _if system.file_creatable?( d: test15.txt ) _then strm
      Message 2 of 4 , Mar 2, 1999
      View Source
      • 0 Attachment
        Try this:

        _if system.file_creatable?("d:\test15.txt")
        _then
        strm << external_text_output_stream.new("d:\test15.txt")
        strm.put_charvec("this is a test")
        strm.newline()
        strm.close()
        _endif


        -----Original Message-----
        From: Joseph Stain [mailto:johnfred2000@...]
        Sent: Tuesday, March 02, 1999 6:19 PM
        To: sw-gis@egroups.com
        Subject: [sw-gis] write to output file



        Hi:

        I want to write to output file (external file).

        I did the following:
        Magik2> s << external_text_output_stream.new("d:\test15.txt")
        an external_text_output_stream
        Magik2> s.write("this is a test")

        This only create the file "d:\test15.txt", but not wrote the text "this
        is a test".

        Thanks in advance !!!



        ______________________________________________________

        ------------------------------------------------------------------------
        Internet FileZone: Always FREE!
        Instantly store & access your valuable PC files on the net,
        from any Web browser.
        SIGN UP NOW - http://offers.egroups.com/click/235/0

        eGroup home: http://www.eGroups.com/list/sw-gis
        Free Web-based e-mail groups by eGroups.com


        ------------------------------------------------------------------------
        eGroup home: http://www.eGroups.com/list/sw-gis
        Free Web-based e-mail groups by eGroups.com
      • Burt, Joe
        As mentioned in a previous note: You must use stream.close() to close the stream off. If you are not ready to close the stream, use stream.flush() ... From:
        Message 3 of 4 , Mar 2, 1999
        View Source
        • 0 Attachment
          As mentioned in a previous note:

          You must use stream.close() to close the stream off. If you are not ready
          to close the stream, use stream.flush()

          -----Original Message-----
          From: Joseph Stain [mailto:johnfred2000@...]
          Sent: Tuesday, March 02, 1999 5:19 PM
          To: sw-gis@egroups.com
          Subject: [sw-gis] write to output file



          Hi:

          I want to write to output file (external file).

          I did the following:
          Magik2> s << external_text_output_stream.new("d:\test15.txt")
          an external_text_output_stream
          Magik2> s.write("this is a test")

          This only create the file "d:\test15.txt", but not wrote the text "this
          is a test".

          Thanks in advance !!!



          ______________________________________________________

          ------------------------------------------------------------------------
          Internet FileZone: Always FREE!
          Instantly store & access your valuable PC files on the net,
          from any Web browser.
          SIGN UP NOW - http://offers.egroups.com/click/235/0

          eGroup home: http://www.eGroups.com/list/sw-gis
          Free Web-based e-mail groups by eGroups.com


          ------------------------------------------------------------------------
          eGroup home: http://www.eGroups.com/list/sw-gis
          Free Web-based e-mail groups by eGroups.com
        • Zareh Langridge
          ... Following on from what Joe has said, the reason you have to use flush is that the stream has a buffer of 1Kb which is where your text gets written to. When
          Message 4 of 4 , Mar 3, 1999
          View Source
          • 0 Attachment
            Burt, Joe wrote:
            >
            > As mentioned in a previous note:
            >
            > You must use stream.close() to close the stream off. If you are not ready
            > to close the stream, use stream.flush()
            >
            Following on from what Joe has said, the reason you have to use flush is that
            the stream has a buffer of 1Kb which is where your text gets written to. When
            the buffer is full it gets flushed and your text will appear in the file or you
            can force it to be flushed using stream.flush(). I found this out once when I
            wrote stuff to a stream and found that my file was missing the last few hundred
            bytes of data.

            Zareh
            --
            zareh@... (Zareh Langridge)
            =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
            Tel. +44 1223 300687 Fax. +44 1223 329359
            =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
            The opinions expressed above are purely personal and not those of my employer

            ------------------------------------------------------------------------
            eGroup home: http://www.eGroups.com/list/sw-gis
            Free Web-based e-mail groups by eGroups.com
          Your message has been successfully submitted and would be delivered to recipients shortly.