Mail Archives: djgpp-workers/2000/10/23/10:38:46
At 01:40 PM 10/23/00 +0200, Eli Zaretskii wrote:
<Snipped>
>`flock' can certainly be implemented using the DOS file-locking
>functions, at least for some of the features supported by `flock' on
>Unix. It's only a question of someone sitting down and coding it.
>(If you do that, please also add the corresponding functionality to
>`fcntl'.)
>
>Note that, apart of `_dos_lock', there's also `lock', that does
>similar things.
But "lock" just calls "_dos_lock", which issues INT 21/AH=5C, which
requires SHARE in plain DOS, if I'm reading Ralf Brown's list
correctly.
>> I realize this leads to problems in plain DOS when
>> no SHARE.EXE is loaded, but a documented requirement to load
>> SHARE.EXE to use the new perl functions or to use perl's "flock"
>> emulation (as well as those functions of "fcntl", of course) would
>> be OK with most folk, wouldn't it?
>
>In general, I won't like telling people to load SHARE. SHARE is
evil;
>see section 9.7 of the FAQ for one aspect of that evilness.
>
>Are you sure you really need SHARE.EXE on plain DOS? Assuming
there's
>only a single program running at any given time (give or take nested
>programs), why would you need that?
My reading of Ralf Brown's list may be incorrect here, but I think
INT21/5C will return an error unless SHARE or some network providing
the "advisory lock" function is loaded. Am I wrong about that?
>More generally, perhaps it would be a good idea to explain to Perl
>non-users, such as myself, what does this "Storable" for persistent
>objects do, to put this discussion into a proper context.
Well, I don't claim to understand the gory details myself, but the
basic idea is stated in the perl "pod" description:
"The Storable package brings persistency to your perl data structures
containing SCALAR, ARRAY, HASH or REF objects, i.e. anything that can
be
convenientely stored to disk and retrieved at a later time."
(Mis-spellings not mine, pasted verbatim.) The functions of this
extension that fail are "lock_store" and "lock_retrieve", which each
perform an "flock" before storing or retrieving, respectively. Other
functions of the package do not fail under DJGPP, only these two. The
package can be used without these two functions, unless you need the
locking functionality for a networked application.
Any further advice you could give on adding this functionality to DJGPP
would be greatly appreciated. In the meantime, I have submitted a
patch to p5p to avoid the problem (give a warning message and return
the perl undefined value) in those two package functions, and not to
test them in the perl "make test" step.
---------------------------------------------------------
Peter J. Farley III (pjfarley AT dorsai DOT org OR
pjfarley AT banet DOT net)
- Raw text -