[ace-users] ACE_File_Lock open failed

Johnny Willemsen jwillemsen at remedy.nl
Tue Jun 19 12:34:54 CDT 2007


Hi,

Please upgrade to x.5.8 which you can obtain from
http://download.dre.vanderbilt.edu

Regards,

Johnny Willemsen
Remedy IT
Postbus 101
2650 AC  Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl =20

*** Integrated compile and test statistics see http://remedy.nl ***
*** Commercial service and support for ACE/TAO/CIAO             ***
*** See http://www.theaceorb.nl/en/support.html                 ***=20

> -----Original Message-----
> From: ace-users-bounces at cse.wustl.edu=20
> [mailto:ace-users-bounces at cse.wustl.edu] On Behalf Of cui shaowei
> Sent: Saturday, June 09, 2007 4:47 AM
> To: ace-users at cse.wustl.edu
> Subject: [ace-users] ACE_File_Lock open failed
>=20
> Hi :
> PRF:
>    TARGET MACHINE :Celeron(R) CPU 2.0GHz ,
>   OPERATING SYSTEM: Win XP Professional sp2
>=20
>    ACE VERSION: 5.5
>    config.h use config-win32.h (use default)
>    COMPILER NAME : VC6.0
>=20
>   question:
>   I want to use ACE_File_Lock to enusre my exe run single instance;
>   #include <ace/OS_NS_unistd.h>
>   #include <ace/OS_NS_stdio.h>
>   #include <ace/File_Lock.h>
>   int main (int argc, ACE_TCHAR *argv[])
>   {
>         ACE_File_Lock fk;
>         if (fk.open ("tmp", 0))
>              ACE_OS::printf ("open failed\n");
>         if (fk.tryacquire_write () =3D=3D -1)
>         {
>               ACE_OS::printf ("You have a running server instance,
> please kill it first!\n");
>              //ACE_OS::fflush (stdout);
>              return -1;
>        }
>        //ACE_OS::sleep (20);
>        return 0;
>   }
>   // also , why ACE_OS::fflush and ACE_OS::sleep link failed=20
> (compile succ)
> --
> =B4=DE=C9=D9=CE=B0
> Tel:    13810421852
> QQ:    43458943
> MSN: shaovie at hotmail.com
>=20



More information about the Ace-users mailing list