note 11524 added to dba_open
| From: | noty at webmaster dot com dot tw | Date: | Fri, 23 Feb 2001 12:07:07 +0000 |
| Subject: | note 11524 added to dba_open | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11471@lists.php.net to get a copy of this message | ||
DBM manual says it uses .lck to apply file locking automatically. DBA seems to have its own locking
mechanics as well.
------------------------- x.php -- >8
#!/usr/local/bin/php -q
<?php
$db = dba_open('test.db', 'n', 'db3') || die;
dba_replace('mykey', 'value1', $db) || die;
sleep(5);
echo dba_fetch('mykey', $db), "\n";
dba_close($db);
------------------------- x.php -- >8
------------------------- y.php -- >8
d$db = dba_open('test.db', 'w', 'db3') || die;
ddba_replace('mykey', 'value2', $db) || die;
decho dba_fetch('mykey', $db), "\n";
ddba_close($db);
------------------------- y.php -- >8
shell> x.php &
shell> y.php
value2
shell> value1
http://www.php.net/manual/en/function.dba-open.php