logo       

should this sample DOS itself ?: msg#00021

Subject: should this sample DOS itself ?

assuming 2 Mbox objects are created to the same mbox file,
Are locks clever enough to avoid the 2nd open being blocked ?
(my test indicates that 2nd connect succeeds)

if so, how does it deal with modifications performed on 2 handles ?
(i havent tried this).

attached prg tries it 2 different ways, with these results:
(btw, Ive got log, trace options to DEBUG, expected more output)..

1. SEPARATE LEXICAL SCOPES, OPENING MBOX SEQUENTIALLY

[jimc@harpo mb-day1]$ perl should-this-self-dos-Q Name "DB::single" used only once: possible typo at should-this-self-dos-Q line 39.
will generate errors opening non-existent mbox
rm mbox.test
PROGRESS: File ./mbox.test for folder ./mbox.test does not exist.
Mail::Box::Mbox->new failed at should-this-self-dos-Q line 58.
touch mbox.test
PROGRESS: Opened folder ./mbox.test to be parsed
NOTICE: Close parser for file ./mbox.test
NOTICE: Close parser for file ./mbox.test
does this dos ?
PROGRESS: Opened folder ./mbox.test to be parsed
NOTICE: Close parser for file ./mbox.test
NOTICE: Close parser for file ./mbox.test
done

Above appears to reclaim locks properly,
tho I dunno why NOTICE comes 2x.


2. DESTROY SUPPRESSED BY COPY B4 OO-SCOPE

displays different DESTROY behavior, but 2nd cant clear lock, as its pre-cleared

[jimc@harpo mb-day1]$ perl should-this-self-dos-Q TRUE

Name "DB::single" used only once: possible typo at should-this-self-dos-Q line 39.
prevent lexical oo-scope cleanups
will generate errors opening non-existent mbox
rm mbox.test
PROGRESS: File ./mbox.test for folder ./mbox.test does not exist.
Mail::Box::Mbox->new failed at should-this-self-dos-Q line 58.
touch mbox.test
PROGRESS: Opened folder ./mbox.test to be parsed
does this dos ?
ouch, found './mbox.test.lock', deleting at should-this-self-dos-Q line 48.
PROGRESS: Opened folder ./mbox.test to be parsed
done
NOTICE: Close parser for file ./mbox.test
NOTICE: Close parser for file ./mbox.test
NOTICE: Close parser for file ./mbox.test
NOTICE: Close parser for file ./mbox.test
Couldn't remove lockfile ./mbox.test.lock: No such file or directory

Looks like 2nd object Destroy failed to unlock, cuz 1st did previously.


FOLLOWON QS

It would be nice to have access => 'rwc', with c == create,
which would do the `touch $file` equivalent, in a robust portable way.

at outset, it seemed to me that 1 or 2 should DOS the mbox file - at least for 2nd
attempt.  Ill try a open1,2 change1, read2.





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe