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
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
On Fri 22 May 2009, Daniel.Li wrote:> 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.Perhaps at that point rsync has chroot()ed somewhere else? Paul
Maybe Matching Threads
- rsync hang, more details [LONG]
- DO NOT REPLY [Bug 5701] New: deadlock on local rsyncing, bisected to commit f303b749f2843433c9acd8218a4b9096d0d1bb8d
- rsync-2.6.1pre-1 hang
- [PATCH] [TRIVIAL] whitespace + variable rename
- [PATCH] Add option --log-after to log after moving file into place