109 unsigned long long dummy, remotefs;
110 int i, retc2, doAdjust = 0, retc =
XrdOssOK;
111 struct stat statbuff;
113 char local_path[MAXPATHLEN+1+8];
114 char remote_path[MAXPATHLEN+1];
119 {strcpy(local_path, path),
130 if (
lstat(local_path, &statbuff)) retc = (errno == ENOENT ? 0 : -errno);
131 else if ((statbuff.st_mode & S_IFMT) == S_IFLNK)
133 else if ((statbuff.st_mode & S_IFMT) == S_IFDIR)
134 {i = strlen(local_path);
135 if (local_path[i-1] !=
'/') strcpy(local_path+i,
"/");
136 if ((retc =
rmdir(local_path))) retc = -errno;
137 DEBUG(
"dir rc=" <<retc <<
" path=" <<local_path);
144 {
if (
unlink(local_path)) retc = -errno;
145 else {i = strlen(local_path);
146 if (doAdjust && statbuff.st_size)
149 DEBUG(
"lcl rc=" <<retc <<
" path=" <<local_path);
155 && (!retc || retc == -ENOENT) &&
RSSCmd)
156 {
if ((retc2 =
MSS_Unlink(remote_path)) != -ENOENT) retc = retc2;
157 DEBUG(
"rmt rc=" <<retc2 <<
" path=" <<remote_path);
175 char *lP, lnkbuff[MAXPATHLEN+64];
176 int lnklen, retc = 0;
180 if ((lnklen = readlink(local_path, lnkbuff,
sizeof(lnkbuff)-1)) < 0)
185 lnkbuff[lnklen] =
'\0';
186 if (
stat(lnkbuff, &statbuff)) statbuff.st_size = 0;
187 else if (
unlink(lnkbuff) && errno != ENOENT)
189 OssEroute.Emsg(
"BreakLink",retc,
"unlink symlink target",lnkbuff);
190 }
else {
DEBUG(
"broke link " <<local_path <<
"->" <<lnkbuff);}
195 lP = lnkbuff+lnklen-1;
197 {
if (statbuff.st_size)
201 }
else if (statbuff.st_size)