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
为何..有没有其他的通用的保证实例唯一性的方法... 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. 我看代码.它应该是会自己创建一个文件的..
刚才我自己touch了一个文件,open成功了..
但if (fk.tryacquire_write () == -1)
ACE_OS::printf ("write failed\n");
失败.. is O_RDWR|O_CREATE will be helpful.
Again, errno!
页:
[1]