[#9854] BUG: ruby-yarv 1.9 undefined method `close' for nil:NilClass in ensure — ville.mattila@...
Hello,
[#9864] String#upto edge case - empty string causes infinite loop — Daniel Berger <Daniel.Berger@...>
Hi,
Hi,
On 1/8/07, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
> -----Original Message-----
On 1/8/07, Berger, Daniel <Daniel.Berger@qwest.com> wrote:
> -----Original Message-----
On 1/9/07, Berger, Daniel <Daniel.Berger@qwest.com> wrote:
[#9869] a block argument within a block which argument has the same name leaks — <noreply@...>
Bugs item #7680, was opened at 2007-01-08 22:53
Hi,
On Jan 8, 2007, at 2:30 PM, Yukihiro Matsumoto wrote:
Hi,
Hi --
Hi,
Hi --
Hi,
Hi,
Evan Phoenix wrote:
Hi,
Yukihiro Matsumoto wrote:
Hi,
On Jan 10, 2007, at 8:43 AM, Yukihiro Matsumoto wrote:
Hi,
Hi,
Hi,
[#9897] Time Zone printing differently for 1.8.4 and 1.8.5. — "Jim Freeze" <jim@...>
> ruby -rparsedate -ve 'puts Time.mktime(* ParseDate.parsedate("Thu Nov 02
[#9908] rdoc for 1.8.5 not creating Module docs? — James Britt <james.britt@...>
When running rdoc over the current 1.8.5 source, the resulting HTML file
[#9926] Fix for File and File::Stat to deal with bogus stat.st_size member — <noreply@...>
Patches item #7760, was opened at 2007-01-11 14:26
On Fri, 12 Jan 2007, noreply@rubyforge.org wrote:
> -----Original Message-----
On Sat, 13 Jan 2007, Berger, Daniel wrote:
[#9949] sandbox 0.4 (r115) with a new patch — _why <why@...>
Okay, here's the latest release of the freaky freaky sandbox.
[#9959] anonymous classes share single alloc function — <noreply@...>
Bugs item #7974, was opened at 2007-01-18 13:28
[#9960] Scoping and locating definitions — Jos Backus <jos@...>
Consider the following:
Jos Backus schrieb:
On Fri, Jan 19, 2007 at 06:40:03PM +0900, Pit Capitain wrote:
On Sat, Jan 20, 2007 at 02:18:19AM +0900, Jos Backus wrote:
Jos Backus schrieb:
On Sun, Jan 21, 2007 at 04:39:52AM +0900, Pit Capitain wrote:
Jos Backus schrieb:
On 1/20/07, Jos Backus <jos@catnook.com> wrote:
[#9969] Allowing Unicode in the grammar? — "Berger, Daniel" <Daniel.Berger@...>
Hi Matz,
[#9996] new method dispatch rule (matz' proposal) — SASADA Koichi <ko1@...>
Hi,
It's late for me here, so I have just brief comments below...
Hi,
SASADA Koichi wrote:
Hi,
On Jan 23, 2007, at 7:41 AM, Yukihiro Matsumoto wrote:
On Tue, 23 Jan 2007, James Edward Gray II wrote:
Hi,
Yukihiro Matsumoto wrote:
Hi,
Yukihiro Matsumoto wrote:
Hi,
The more this discussion goes on, the more I worry that Joe Q Public
Hi,
[#10019] stable branch policy & schedule for 1.8.6 — "Akinori MUSHA" <knu@...>
Core developers,
Akinori MUSHA wrote:
Charles Oliver Nutter wrote:
At Wed, 24 Jan 2007 15:13:52 +0900,
Hello,
Hi,
On Jan 23, 2007, at 22:13, Joel VanderWerf wrote:
[#10066] class variables and inheritance — <noreply@...>
Bugs item #8156, was opened at 2007-01-25 15:05
[#10068] Re: Method Dispatch (was Adding methods to String, but only in my own Module?) — gwtmp01@...
[#10085] Collaborative Ruby Language Specification — "John Lam (CLR)" <jflam@...>
Hi Everyone,
On 1/28/07, John Lam (CLR) <jflam@microsoft.com> wrote:
Hi --
>> I'm not sure what there is to be non-neutral about :-)
Hi --
On Mon, 29 Jan 2007, dblack@wobblini.net wrote:
John Lam (CLR) wrote:
> I hope such a spec would be developed "in the open" from the beginning,
M. Edward (Ed) Borasky wrote:
-----BEGIN PGP SIGNED MESSAGE-----
On 1/30/07, Eustaquio Rangel de Oliveira Jr. <eustaquiorangel@yahoo.com> wrote:
On 1/30/07, Nikolai Weibull <now@bitwi.se> wrote:
> > I was checking some CLR opinions and - correct me please if I'm wrong - seems
[#10114] add usage of uri.userinfo to open-uri.rb — <noreply@...>
Patches item #8309, was opened at 2007-01-30 15:25
On 2007/01/31, at 06:07, Yukihiro Matsumoto wrote:
Hi,
On Thu, Feb 01, 2007 at 01:19:34AM +0900, Yukihiro Matsumoto wrote:
Hi,
Hi matz,
Hi,
On Feb 2, 2007, at 7:40 PM, Yukihiro Matsumoto wrote:
[#10135] Another .document patch. — Hugh Sasse <hgs@...>
I have been looking at the tips for irb at:
[ ruby-Patches-7760 ] Fix for File and File::Stat to deal with bogus stat.st_size member
Patches item #7760, was opened at 2007-01-11 14:26
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=7760&group_id=426
Category: Ruby1.8
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Daniel Berger (djberg96)
Assigned to: Nobody (None)
Summary: Fix for File and File::Stat to deal with bogus stat.st_size member
Initial Comment:
Hi all,
It seems that the stat() function has a bug on Solaris 10 (06/06) where it doesn't set the st_size value to NULL for character or block devices. Instead, it seems to default to INT_MAX, which results in bogus information returned by File::Stat.
For example:
irb(main):001:0> File.stat("/dev/fd0").size
=> 9223372036854775807
That should return 0. This has been reported on sunsolve.sun.com (bug 4013608), but I'm not positive if it's been patched yet, or if it affects other Solaris versions, because I don't have a sunsolve account (i.e. I can see the ticket summary but not the details).
This affects the following methods:
File::Stat#size
File::Stat#size?
File::Stat#zero?
File.size
File.size?
File.zero?
I'm not sure if you take patches for bugs in the underlying OS or not. If you do accept them, here's the patch. I've also included a small test suite that now passes on my Solaris box. Note that I've only added explicit comments on the approach I use here in one function (rb_stat_size). Copy and paste if you would like it added to each of the functions.
--- file.orig Tue Jan 9 10:57:09 2007
+++ file.c Thu Jan 11 14:08:34 2007
@@ -467,7 +467,15 @@
rb_stat_size(self)
VALUE self;
{
- return OFFT2NUM(get_stat(self)->st_size);
+ struct stat *st = get_stat(self);
+
+ /* Block and character devices are handled explicitly because some
+ * platforms set the st_size member to an incorrect value.
+ */
+ if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
+ return INT2FIX(0);
+
+ return OFFT2NUM(st->st_size);
}
/*
@@ -1257,7 +1265,9 @@
struct stat st;
if (rb_stat(fname, &st) < 0) return Qfalse;
- if (st.st_size == 0) return Qtrue;
+ if (st.st_size == 0 || S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))
+ return Qtrue;
+
return Qfalse;
}
@@ -1276,7 +1286,9 @@
struct stat st;
if (rb_stat(fname, &st) < 0) return Qnil;
- if (st.st_size == 0) return Qnil;
+ if (st.st_size == 0 || S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))
+ return Qnil;
+
return OFFT2NUM(st.st_size);
}
@@ -1481,7 +1493,11 @@
struct stat st;
if (rb_stat(fname, &st) < 0)
- rb_sys_fail(StringValueCStr(fname));
+ rb_sys_fail(StringValueCStr(fname));
+
+ if( S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode) )
+ return INT2FIX(0);
+
return OFFT2NUM(st.st_size);
}
@@ -3981,7 +3997,10 @@
rb_stat_z(obj)
VALUE obj;
{
- if (get_stat(obj)->st_size == 0) return Qtrue;
+ struct stat *st = get_stat(obj);
+ if (st->st_size == 0 || S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
+ return Qtrue;
+
return Qfalse;
}
@@ -4000,10 +4019,11 @@
rb_stat_s(obj)
VALUE obj;
{
- off_t size = get_stat(obj)->st_size;
+ struct stat *st = get_stat(obj);
+ if (st->st_size == 0 || S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
+ return Qnil;
- if (size == 0) return Qnil;
- return OFFT2NUM(size);
+ return OFFT2NUM(st->st_size);
}
/*
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=1700&aid=7760&group_id=426