EOF-file missing

Discussion in 'Python' started by Tor Erik Sønvisen, Apr 14, 2005.

  1. Hi

    From a client I read a file into a string using read().
    On the server-side (it's a HTTPServer) i access the same string through the
    input stream rfile.
    However all useful read-methods (readlines, readline, read) expect an EOF
    before terminating.
    And for some reason the stream doesn't have the seek method either, so it's
    impossible to set the file-pointer to the end of the stream.
    how can I access the whole string then?
    Is it possible to add an EOF to the string before sending it from the
    client? Or maybe there are other solutions?

    regards
     
    Tor Erik Sønvisen, Apr 14, 2005
    #1
    1. Advertisements

  2. Tor Erik Sønvisen

    infidel Guest

    You can use the Content-Length header to tell the server how long the
    string is.
     
    infidel, Apr 14, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sacha Korell
    Replies:
    2
    Views:
    15,972
    Mattias Sjögren
    Sep 6, 2003
  2. Robert

    C++ file io -- eof trouble

    Robert, Sep 15, 2003, in forum: C++
    Replies:
    3
    Views:
    777
    Rob Williscroft
    Sep 15, 2003
  3. Karlo Basic

    EOF (end of file) problem

    Karlo Basic, Nov 1, 2003, in forum: C++
    Replies:
    5
    Views:
    1,018
    Jack Klein
    Nov 1, 2003
  4. Gary Herron
    Replies:
    2
    Views:
    853
    Bruno Desthuilliers
    Jul 4, 2006
  5. Kobu
    Replies:
    10
    Views:
    931
    Keith Thompson
    Mar 4, 2005
  6. AB@
    Replies:
    2
    Views:
    1,702
  7. SpreadTooThin

    ifstream eof not reporting eof?

    SpreadTooThin, Jun 13, 2007, in forum: C++
    Replies:
    10
    Views:
    982
    James Kanze
    Jun 15, 2007
  8. Jan Burse
    Replies:
    67
    Views:
    1,606
    Jan Burse
    Mar 14, 2012
Loading...