https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112016-05-23T06:05:57ZRuby Issue Tracking SystemRuby master - Bug #12415: Dir#pos reports invalid position after Dir#readhttps://bugs.ruby-lang.org/issues/12415?journal_id=588172016-05-23T06:05:57Zphasis68 (Heesob Park)phasis@gmail.com
<ul></ul><p>This is not a bug.<br>
The return value of Dir#pos is just the return value of telldir().<br>
The return values of telldir() are implementation-defined.</p>
<p>According to <a href="http://man7.org/linux/man-pages/man3/telldir.3.html" class="external">http://man7.org/linux/man-pages/man3/telldir.3.html</a></p>
<pre><code>In glibc up to version 2.1.1, the return type of telldir() was off_t.
POSIX.1-2001 specifies long, and this is the type used since glibc
2.1.2.
In early filesystems, the value returned by telldir() was a simple
file offset within a directory. Modern filesystems use tree or hash
structures, rather than flat tables, to represent directories. On
such filesystems, the value returned by telldir() (and used
internally by readdir(3)) is a "cookie" that is used by the
implementation to derive a position within a directory. Application
programs should treat this strictly as an opaque value, making no
assumptions about its contents.
</code></pre> Ruby master - Bug #12415: Dir#pos reports invalid position after Dir#readhttps://bugs.ruby-lang.org/issues/12415?journal_id=588212016-05-23T11:05:47Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul>