[Rd] documentation enhancement: Note in ?seek for Windows (PR#7943)

From: <tplate_at_blackmesacapital.com>
Date: Wed 15 Jun 2005 - 18:49:52 GMT

[I started a new bug report for this issue because it was not the primary issue in the original discussion, which was PR#7899]

ligges@statistik.uni-dortmund.de wrote:
> Tony Plate wrote:
> [snip]
>>ligges@statistik.uni-dortmund.de wrote:
>>>Note that ?seek currently tells us "The value returned by
>>>seek(where=NA) appears to be unreliable on Windows systems, at least
>>>for text files."
>>>It would be nice if this comment could be removed, of course ....
>>May the explanation could be given that this happens with text files
>>because Windows inserts extra characters at end-of-lines when reading
>>"text" mode files (but with binary files, things should be fine.) This
>>particular issue is documented in Microsoft Windows documentation (e.g.,
>>at http://msdn2.microsoft.com/library/75yw9bf3(en-us,vs.80).aspx, found
>>by searching on Google using the terms "fseek windows documentation").
>>Are there any known issues using seek with binary files under Windows?
>>If there are not, then the caveat could be made specific to text files
>>and all vagueness removed.
> Hmm, all I find (including your link) is Windows CE related ...
> Uwe Ligges

For the record, the documentation I pointed to is for Windows 2000 etc, and is not just related to Windows CE (Uwe retracted that claim in a private email).

So, the suggestion to refine the note in ?seek stands. Perhaps src/library/base/man/seek.Rd could be changed as follows:

OLD: #ifdef windows

   The value returned by \code{seek(where=NA)} appears to be unreliable    on Windows systems, at least for text files. Clipboard connections    can seek too.

NEW: #ifdef windows

   The value returned by \code{seek()} is unreliable    on Windows systems for text files. This is because the Windows    file-I/O functions can insert extra characters at end-of-lines    when working with text mode files. Binary mode files should not    be affected by this issue. Clipboard connections can seek too. #endif

Of course, if someone knows that the return value of seek() is unreliable on Windows for binary files, this documentation change is innappropriate (and then the documentation should probably be changed from "appears to be unreliable, at least for text files" to "is unreliable, for both binary and text files".

R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jun 16 04:52:45 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:09 GMT