From: Sean Chittenden Date: 2001-08-25T16:11:00+09:00 Subject: [ruby-talk:20354] File.new() strangeness... --4ZLFUWh1odzi/v6L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Can someone explain why this doesn't work: seanl:src/apache > ruby f =3D File.new('testing', 0600, File::CREAT|File::TRUNC|File::WRONLY|File::= EXCL) f.puts('foobar') f.close()^D -:1:in `initialize': No such file or directory - "testing"=20 (Errno::ENOENT) from -:1:in `new' from -:1 It shouldn't matter that there's no file called testing with=20 File::CREAT specified. Here's what truss has to say about this: open("testing",384,07001) ERR#2 'No such file or directory' The arguments seem just backwards to me. Here's a blurb from a=20 test program: fd =3D open("testing", O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR); printf("Open flags: %d, %d\n", O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR); And outputs: 'Open flags: 1537, 384' with a file 'testing' mod 0600. Anyone able to shed some light on the subject? -sc --=20 Sean Chittenden --4ZLFUWh1odzi/v6L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: Sean Chittenden iEYEARECAAYFAjuHTHsACgkQn09c7x7d+q1+FgCfQ6w54ijSQ/Xd9zZuxuDGZfKZ 8BUAn3oOi5IyGO64hCq7j6leQReECe8x =9ONV -----END PGP SIGNATURE----- --4ZLFUWh1odzi/v6L--