找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 4325|回复: 3

ACE_File_Lock open failed

[复制链接]
发表于 2008-5-21 23:23:23 | 显示全部楼层 |阅读模式
我想用ACE_File_Lock 来保证我的运行实例唯一..
但在window 下..
ACE_File_Lock fk;
if (fk.open ("cccccccccc", O_RDWR))
   ACE_OS::printf ("open failed\n");
open failed
为何..有没有其他的通用的保证实例唯一性的方法...
 楼主| 发表于 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.
 楼主| 发表于 2008-5-21 23:23:39 | 显示全部楼层
我看代码.它应该是会自己创建一个文件的..

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

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

失败..
 楼主| 发表于 2008-5-21 23:23:46 | 显示全部楼层
is O_RDWR|O_CREATE will be helpful.
Again, errno!
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-11-22 02:01 , Processed in 0.011325 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表