mbowie at buzmo dot com wrote:
"The result of this is that if you're using "1" as the id on the PHP side, you'll need to use 49 elsewhere."
You can always use chr() as an alternative.
![]() |
|
||||||||||
|
ftokDescriptionint ftok ( string pathname, string proj )
The function converts the On success the return value will be the created key value, otherwise -1 is returned. See also shmop_open() and sem_get(). ftok
Peter MOLNAR
18-May-2007 05:38
mbowie at buzmo dot com wrote:
marco at greenlightsolutions dot nl
17-Apr-2007 08:08
As ftok uses only the last 16 bits of the inode of the file, you can get collisions on large filesystems. Unfortunately, on large filesystems you can get collisions rather quickly: if you have a collection of 350-400 files, odds are that two of them have inodes with the same last 16 bits. So I've taken to using fileinode instead of ftok with functions like shmop_open.
mbowie at buzmo dot com
20-Oct-2004 02:41
If you're planning to use ftok() to generate an IPC identifier to share with other applications, note that PHP uses the ASCII value of the proj parameter to generate the key, not the proj (aka id) parameter itself.
abk at avatartechnology dot com
17-Jun-2004 01:17
Thanks to daniele_dll@yahoo.it who got this in turn from linux glibc 2.3.2: http://www.php.net/manual/en/function.shmop-open.php -- I'm putting this here because it might be helpful to others.
david dot rech at virusmedia dot de
26-May-2004 07:50
Missing ftok() on Windows? Here's my little workaround:
kimaz at swecom dot org
02-May-2004 06:35
You dont have to use ftok() for specifying an System V IPC identifier, though its a good thing to do so.
andreyKEINSPAM at php dot net
24-Apr-2004 09:43
This function is not part neither of ext/sysvsem nor ext/sysvshm but comes with the core functions of PHP (from ext/standard).
|