peakzhang 发表于 2008-5-21 23:23:23

ACE_File_Lock open failed

我想用ACE_File_Lock 来保证我的运行实例唯一..
但在window 下..
ACE_File_Lock fk;
if (fk.open ("cccccccccc", O_RDWR))
   ACE_OS::printf ("open failed\n");
open failed
为何..有没有其他的通用的保证实例唯一性的方法...

peakzhang 发表于 2008-5-21 23:23:31

Do u have "cccccccccc" ready?
Do u have right permission?
....
Come on guys, why it's so difficult to printf("err %d\n", ACE_OS::last_error());
You just make simple question become a guessing game.

peakzhang 发表于 2008-5-21 23:23:39

我看代码.它应该是会自己创建一个文件的..

刚才我自己touch了一个文件,open成功了..

但if (fk.tryacquire_write () == -1)
      ACE_OS::printf ("write failed\n");

失败..

peakzhang 发表于 2008-5-21 23:23:46

is O_RDWR|O_CREATE will be helpful.
Again, errno!
页: [1]
查看完整版本: ACE_File_Lock open failed