New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
binmode() affects seek() and tell() ? #8149
Comments
From pfusik@op.plThis is a bug report for perl from pfusik@op.pl, The last paragraph of "perldoc -f binmode" says that binmode() Flags: Site configuration information for perl v5.8.7: Configured by builder at Mon Jun 6 13:36:05 2005. Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Locally applied patches: @INC for perl v5.8.7: Environment for perl v5.8.7: PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\U;C:\JAVA\JDK\BIN;C:\C\DJGPP\BIN;C:\J\PERL\BIN;C:\J\MYSQL\BIN;C:\U\TEXMF\MAIN\MIKTEX\BIN;C:\U\ |
From pfusik@op.plI wrote:
No-one here knows that? Piotr |
From @ysthOn Sat, Oct 15, 2005 at 03:22:20PM +0200, Piotr Fusik wrote:
I don't see any specific mention of binmode actually affecting seek and
The seek and tell doc are referring to bytes vs. characters, not |
The RT System itself - Status changed from 'new' to 'open' |
From pfusik@op.pl
If binmode() cannot affect seek() and tell() in any way, it is a nonsense
Whether it is fine to do seek() before calling binmode() and reading data.
Do you mean bytes/utf8 mode doesn't matter but crlf does? Piotr |
From @ysthOn Sun, Oct 16, 2005 at 11:48:37PM +0200, Piotr Fusik wrote:
It's important in the sense that with it, you should be able to seek
AFAIK that should work, unless there's some OS that makes tell()
crlf is an in-between case; it's one byte in memory but two on the disk. |
From pfusik@op.pl
I wouldn't say this means that binmode() is important
I doubt. If it would be so, descriptions of tell() and seek()
Now I wonder how tell() and relative-seek() can reliably |
From @wb8tywI am jumping in here from my faulty memory because I do not have time to Piotr Fusik wrote:
Unless something is being done special for Perl on OpenVMS, only in the OpenVMS for the native text file format, OpenVMS does not store the "LF" When the OpenVMS C library reads that file in, unless the file is opened Note though that because it is a counted field, any character value can Because of that, tell() only knows for sure the record offset into the There is a fgetpos() and fsetpos() that know how to find and get to the I have tried to find a way for seek() and tell() to be accurate on a The only way I could find was to reread the entire file if a seek() was When you start having to do that on a file that is several megabytes in
With any operating system that has record oriented files and is
I would have to read their precise wording to see that.
Actually it could be 0 bytes on disk, and what should be presented just
It is platform dependent unless the on disk format is just a stream of This is the case on UNIX, but it is not the case on other platforms. OpenVMS has several record formats where reading them in binary mode If I get a file from a DOS system with CR-LF terminators and the file The same is true with a file from a UNIX system on VMS. As long as the -John |
Migrated from rt.perl.org#37419 (status was 'open')
Searchable as RT37419$
The text was updated successfully, but these errors were encountered: