dce quagga 1.7 file access problem

10 views
Skip to first unread message

bright....@gmail.com

unread,
Sep 10, 2016, 8:00:42 AM9/10/16
to ns-3-users
hi, everyone
I got a problem when I'm using dce quagg 1.7.
When I write this code in my dce application code, 

    if((fp = fopen("/home/test/1w3e.txt", "wt"))==NULL){
        printf("fopen error\n");
        exit(1);
    }
    fprintf(fp, "Hello world!");
    fclose(fp);

I always get a NULL pointer from fopen function, but in real environment, it works well.

Has anyone come across this before?

Thanks!

Matt Anonyme

unread,
Sep 10, 2016, 8:28:11 AM9/10/16
to ns-3-users
dce does some kind of chrooting in "files-X/" folders (with X the node id). Thus you should copy your file in one such folder.

bright....@gmail.com

unread,
Sep 10, 2016, 8:46:59 AM9/10/16
to ns-3-users
it doesn't work, though.
I run
 touch files-5/home/test/1w3e.txt
and run waf again,but the file 1w3e.txt is still blank.


在 2016年9月10日星期六 UTC+8下午8:28:11,Matt Anonyme写道:

Matt

unread,
Sep 10, 2016, 8:52:38 AM9/10/16
to ns-3-users
try to look with a debugger what could happen, put a breakpoint on
dce_fopen is defined in dce-stdio.cc. what is the "t" in "wt" , it
doesn't appear in the manpage. SHouldn't it be a "+" ?
Reply all
Reply to author
Forward
0 new messages