peakzhang 发表于 2007-12-11 22:25:22

ACE_OS::write 的问题

以下内容为程序代码:


#include <ace/OS_NS_stdio.h>
#include <ace/OS_NS_fcntl.h>

int main (int argc, char *argv[])
{
    ACE_HANDLE fd= ACE_OS::open ("shaowei", O_CREAT | O_APPEND, 0644);
    perror ("open");
    ACE_OS::write (fd, "cui", 3);
    perror ("write");
    return 0;
}

执行后

# ./a.out
open: Success
write: Bad file descriptor

peakzhang 发表于 2007-12-11 22:25:30


ACE_HANDLE fd= ACE_OS::open ("shaowei", O_CREAT | O_RDWR, 0644);
页: [1]
查看完整版本: ACE_OS::write 的问题