note 79430 added to function.shmop-open
| From: | erelsgl at gmail dot com | Date: | Tue, 27 Nov 2007 11:04:14 +0000 |
| Subject: | note 79430 added to function.shmop-open | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132589@lists.php.net to get a copy of this message | ||
=== Checking if a shared memory exists ===
The solution provided by Mitchell_Shnier at ieee dot orgZ doesn't work on my computer - I get a
warning "Invalid flag ac".
In order to check if a shared-memory exists, you just have to open it with the "a" or
"w" flag, while hiding the warnings using the "@" operator:
<?php
@$shid = shmop_open($systemId, "a", 0666, 0);
if (!empty($shid)) {
... shared memory exists
} else {
... shared memory doesn't exist
}
?>
----
Server IP: 82.80.248.162
Probable Submitter: 217.132.178.244
----
Manual Page -- http://www.php.net/manual/en/function.shmop-open.php
Edit -- https://master.php.net/note/edit/79430
Del: integrated -- https://master.php.net/note/delete/79430/integrated
Del: useless -- https://master.php.net/note/delete/79430/useless
Del: bad code -- https://master.php.net/note/delete/79430/bad+code
Del: spam -- https://master.php.net/note/delete/79430/spam
Del: non-english -- https://master.php.net/note/delete/79430/non-english
Del: in docs -- https://master.php.net/note/delete/79430/in+docs
Del: other reasons-- https://master.php.net/note/delete/79430
Reject -- https://master.php.net/note/reject/79430
Search -- https://master.php.net/manage/user-notes.php