Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Problems using struct pack/unpack in files, and reading them. Date: Fri, 13 Nov 2015 21:17:59 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 17 Message-ID: References: <20151113192045.GA9913@z-sverige.nu> <20151113201510.GA10107@z-sverige.nu> NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net X-Trace: reader1.panix.com 1447449479 22631 67.130.15.94 (13 Nov 2015 21:17:59 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 13 Nov 2015 21:17:59 +0000 (UTC) User-Agent: slrn/1.0.2 (Linux) Xref: csiph.com comp.lang.python:98770 On 2015-11-13, Ian Kelly wrote: > Either retain the read data between calls, or call seek(0) before > reading it again. It has always saddened me that Python files don't have a rewind() method. On Unix, calling rewind() is the same as calling seek(0), so it's utterly pointless except as an amusing anachronistic name: it always made me smile when called rewind() on a file in a filesystem on a hard-drive. Interestingly, you can't you can't (and never could) use rewind() to rewind a tape. You use an ioctl() system call for that. -- Grant Edwards grant.b.edwards Yow! HUGH BEAUMONT died at in 1982!! gmail.com