[#2529] concerns about Proc,lambda,block — "David A. Black" <dblack@...>
Hi --
>>>>> "D" == David A Black <dblack@wobblini.net> writes:
Hi --
Hi,
On Tue, 2 Mar 2004 08:44:25 +0900, Yukihiro Matsumoto wrote:
Hi,
On Wednesday, 3 March 2004 at 8:00:09 +0900, Yukihiro Matsumoto wrote:
Hi,
Hi,
On Wed, Mar 03, 2004 at 07:51:10AM +0900, Yukihiro Matsumoto wrote:
Hi,
On Thu, 4 Mar 2004, Yukihiro Matsumoto wrote:
Hi,
[#2575] Comment football being played... with lib/test/unit.rb — Nathaniel Talbott <nathaniel@...>
[Resent because I accidentally signed it the first time]
[#2577] problem with Net::HTTP in 1.8.1 — Ian Macdonald <ian@...>
Hello,
Hi,
[#2582] One more proc question — Dave Thomas <dave@...>
Sorry about this... :)
Hi,
On Friday, 5 March 2004 at 12:52:15 +0900, Yukihiro Matsumoto wrote:
Hi,
[#2588] Duck typing chapter — Dave Thomas <dave@...>
I've posted a rough first pass at a chapter about duck typing (and
[#2606] Thought about class definitions — Dave Thomas <dave@...>
If we allowed
[#2628] YAML complaint while generating RDoc — Dave Thomas <dave@...>
With the latest CVS, I get
[#2640] patch to tempfile.rb to handle ENAMETOOLONG — Joel VanderWerf <vjoel@...>
[#2644] RDoc proporsal — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Hi, rubyists.
[#2646] Problems rdoc'ing cvs... — Hugh Sasse Staff Elec Eng <hgs@...>
I have just done
On Friday, March 12, 2004, 4:15:42 AM, Dave wrote:
On Fri, 12 Mar 2004, Dave Thomas wrote:
[#2661] Pathological slowdown in 1.8 — Ryan Davis <ryand@...>
Hi all,
[#2697] lib/ruby/1.9/yaml.rb:193: [BUG] Segmentation fault — Mauricio Fern疣dez <batsman.geo@...>
Mauricio Fern疣dez wrote:
On Sun, Mar 28, 2004 at 09:42:42AM +0900, why the lucky stiff wrote:
[#2703] Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...>
This patch adds support to Net::POP for doing POP over SSL. Modeled on how
This is v2 of the patch. Cleaned up a bit and added some more docs.
v3 of the patch:
Hi,
I agree that there are a lot of arguments to #start, but I think it is the
On Tue, 30 Mar 2004 16:24:17 +0900, Daniel Hobe wrote:
On Wed, 31 Mar 2004 13:27:31 +0900, Daniel Hobe wrote:
On Tue, Mar 30, 2004 at 04:05:06PM +0900, Minero Aoki wrote:
[#2709] typos in lib/singleton.rb — Ian Macdonald <ian@...>
Hello,
[#2713] more spelling and grammar fixes — Ian Macdonald <ian@...>
Hello,
> Hello,
Hi,
[PATCH] IO#fsync on fds opened as RO
Patch
diff -r -U 10 ruby-1.8.1/io.c ruby-1.8.1.inst/io.c
--- ruby-1.8.1/io.c 2004-03-18 15:52:24.000000000 +0100
+++ ruby-1.8.1.inst/io.c 2004-03-18 15:55:30.000000000 +0100
@@ -601,21 +601,20 @@
static VALUE
rb_io_fsync(io)
VALUE io;
{
#ifdef HAVE_FSYNC
OpenFile *fptr;
FILE *f;
GetOpenFile(io, fptr);
- rb_io_check_writable(fptr);
f = GetWriteFile(fptr);
io_fflush(f, fptr);
if (fsync(fileno(f)) < 0)
rb_sys_fail(fptr->path);
return INT2FIX(0);
#else
rb_notimplement();
return Qnil; /* not reached */
#endif
Rationale
dir = open("somedir", "r")
dir.fsync
fails with a 'IOError: not opened for writing', due to an explicit check
in io.c ('rb_io_check_writable(fptr);').
On the other hand,
dir = open("somedir", "w") raises Errno::EISDIR: Is a directory, as does
dir = open("somedir", "a").
However, the following works on my system (Linux 2.4)
batsman@tux-chan:/tmp/atomic/a/bla$ cat test.c
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int
main(int argc, char *argv[])
{
int dir, fd;
int ret;
dir = open("bleh", O_RDONLY);
fd = open("journal", O_RDONLY);
printf("dir is %d\n", dir);
printf("fd is %d\n", fd);
ret = fsync(dir);
printf("ret for dir is %d\n", ret);
ret = fsync(fd);
printf("ret for fd is %d\n", ret);
close(dir);
close(fd);
}
batsman@tux-chan:/tmp/atomic/a/bla$ touch journal; mkdir bleh
batsman@tux-chan:/tmp/atomic/a/bla$ ./test
dir is 3
fd is 4
ret for dir is 0
ret for fd is 0
Additionally, SuSv2 indicates that
"The open() function will fail if: (...)
[EISDIR]
The named file is a directory and oflag includes O_WRONLY or O_RDWR."
http://www.opengroup.org/onlinepubs/007908799/xsh/open.html
and man fsync under Linux indicates the following:
"It does not necessarily ensure that the entry in the directory containing
the file has also reached disk. For that an explicit fsync on the file
descriptor of the directory is also needed."
If we cannot open a dir as WO or RW, and yet it is possible to fsync(dir)
(nothing in SuSv2 says explicitly that this is impossible), we can't but
conclude that fsync(dir) is OK for a dir opened as RO. Also, I couldn't
find any reason why fsync(file) should fail for a file opened in RO
mode.
--
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
How many chunks could checkchunk check if checkchunk could check chunks?
-- Alan Cox