[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] sysopen



On Mon, Jul 12, 1999 at 01:57:26PM -0400, Chris Nandor wrote:
} What am I missing (if anything)?
} 
}   #!perl -wl
}   use Fcntl;
}   sysopen FILE, "foo", O_RDWR|O_TRUNC|O_CREAT or die $!;
}   print FILE "ha!";
}   close FILE;

The problem seems to be that O_RDWR has the wrong value.  When I print
it out, I get 0 instead of the expected (from /usr/include/asm/fcntl.h
on m LinuxPPC R4 machine) 2.  When I replace O_RDWR with 0x2 on the
only Mac I have running MacOS at the moment, my Powerbook running
5.20r4, MacOS 7.6.1, your script works.  Otherwise it fails just like
it does for you.  (The script works under LinuxPPC.)  Check the
CodeWarrior headers and see what they have.  0 is the read-only value.

} 
}   __END__
} 
} Returns:
} 
}   # Filehandle main::FILE opened only for input.
}   File 'Untitled #4'; Line 4
} 
} --
} Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
} %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])
} 
} ===== Want to unsubscribe from this list?
} ===== Send mail with body "unsubscribe" to macperl-request@macperl.org
} 
} 

-- 
Paul Schinder
schinder@pobox.com

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org