Really weird! root folder is OK, but others returned -1. Why? I'm in recv_files access / ret = 0 I'm in recv_files access /home ret = -1 I'm in recv_files access /home/admin ret = -1 I'm in recv_files access /home/admin/test ret = -1
Thoese folder does exist. I use rsync --daemon to launch the program and triggered with another rsync client. drwxr-xr-x 7 root root 4096 2009-03-31 16:29 home drwxr-xr-x 6 admin admin 4096 2009-05-22 15:24 admin drwxrwxrwx 3 admin admin 4096 2009-05-22 15:27 test BTW, rsync version 3.0.5. Any help is really appreciated. On Fri, 2009-05-22 at 16:14 +0800, Daniel.Li wrote: > Dear List, > When I use "access" function to find out if the folder exist in rsync > code. I found that it's will NOT act as normal function. > > I have tried 2 test: > > a) embedded in rsync function "int recv_files(int f_in, char > *local_name)" and hard coded with following line. > > access("/home/admin/test",F_OK) > > Result: Failed with -1, just mean the test folder is NOT existed, but it > does exist. > > b) simple "hello world program" > > OK. > > Result: return 0, folder exist. > > > Right now, I can't figure out what's wrong. Can anyone give a tip? > > Thanks in advance. > > > -- > Daniel > -- Daniel Li -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html