Re: Why is this dup failing under BSD?



Robert Nicholson wrote:
I've been doing the following in order to use flock ie. covert a file
descriptor to a File Handle

my %hash;
my $hash = tie (%hash, 'DB_File', $listsDb, O_RDONLY|O_CREAT, 0644)
or
die "Cannot open $listsDb\n";

my $fd = $hash->fd;
open(DB_FH, "+<&=$fd") or die "dup $!";
flock (DB_FH, LOCK_SH) or die "flock: $!";


under BSD I get an error when I do this.

Patient: Doctor it hurts when I do this.

Doctor: Well, don't do that.

(is BSD always on top?)


Can anybody tell me why?

My ESP tells me ... wait ... I see an error on line 42 ... no ... wait ...
line 15 ... does "line 15" mean anything to you?




John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
.



Relevant Pages

  • Re: Euthanasia
    ... >> euthanasia - a doctor administering a fatal dose of painkiller to put ... > It most certainly is wrong if the patient expresses the desire not to be ... But if while in agony he says that he wants to die, ... that also ought to be respected. ...
    (uk.legal)
  • OT: JOKE....Poor Guy!
    ... The doctor examines the man briefly and concludes ... that the patient will die if he doesn't have his ... "You want to die?" ... penis has to go. ...
    (alt.support.stop-smoking)
  • Re: Life or death question
    ... Is it wrong for a doctor to withhold such information from a patient? ... If they're going to die, ... The doctor tells the family but not the patient. ...
    (alt.support.chronic-pain)
  • Re: JOKE....Poor Guy!
    ... > "I think I have a problem, Doc," says a patient. ... > "One of my balls has turned blue." ... > The doctor examines the man briefly and concludes ... > that the patient will die if he doesn't have his ...
    (alt.support.stop-smoking)
  • Life or death question
    ... Is it wrong for a doctor to withhold such information from a patient? ... they're going to die, should they be told? ... the rest of their lives, ...
    (alt.support.chronic-pain)