Changes to mbfile for symbolic links processing
This commit is contained in:
@@ -325,6 +325,19 @@ void Check(void)
|
||||
Syslog('!', "Weird problem, %s is no regular file", newdir);
|
||||
}
|
||||
|
||||
/*
|
||||
* It could be that there is a thumbnail made of the LFN.
|
||||
*/
|
||||
tname = calloc(PATH_MAX, sizeof(char));
|
||||
sprintf(tname, "%s/.%s", area.Path, file.LName);
|
||||
if (file_exist(tname, R_OK) == 0) {
|
||||
Syslog('+', "Removing thumbnail %s", tname);
|
||||
iErrors++;
|
||||
unlink(tname);
|
||||
}
|
||||
free(tname);
|
||||
|
||||
|
||||
if (file_time(newdir) != file.FileDate) {
|
||||
Syslog('!', "Date mismatch area %d file %s", i, file.LName);
|
||||
file.FileDate = file_time(newdir);
|
||||
|
@@ -566,25 +566,25 @@ void Index(void)
|
||||
*/
|
||||
if (strstr(file.LName, ".gif") || strstr(file.LName, ".jpg") ||
|
||||
strstr(file.LName, ".GIF") || strstr(file.LName, ".JPG")) {
|
||||
sprintf(linebuf, "%s/%s", area.Path, file.LName);
|
||||
sprintf(outbuf, "%s/.%s", area.Path, file.LName);
|
||||
sprintf(linebuf, "%s/%s", area.Path, file.Name);
|
||||
sprintf(outbuf, "%s/.%s", area.Path, file.Name);
|
||||
if (file_exist(outbuf, R_OK)) {
|
||||
if ((j = execute(CFG.www_convert, linebuf, outbuf,
|
||||
(char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null"))) {
|
||||
Syslog('+', "Failed to create thumbnail for %s, rc=% d", file.LName, j);
|
||||
Syslog('+', "Failed to create thumbnail for %s, rc=% d", file.Name, j);
|
||||
} else {
|
||||
chmod(outbuf, 0644);
|
||||
}
|
||||
}
|
||||
sprintf(outbuf, "%s/%s%s/%s", CFG.www_url, CFG.www_link2ftp,
|
||||
area.Path+strlen(CFG.ftp_base), file.LName);
|
||||
area.Path+strlen(CFG.ftp_base), file.Name);
|
||||
sprintf(linebuf, "%s/%s%s/.%s", CFG.www_url, CFG.www_link2ftp,
|
||||
area.Path+strlen(CFG.ftp_base), file.LName);
|
||||
MacroVars("fghi", "dsss", 1, outbuf, file.LName, linebuf);
|
||||
area.Path+strlen(CFG.ftp_base), file.Name);
|
||||
MacroVars("fghi", "dsss", 1, outbuf, file.Name, linebuf);
|
||||
} else {
|
||||
sprintf(outbuf, "%s/%s%s/%s", CFG.www_url, CFG.www_link2ftp,
|
||||
area.Path+strlen(CFG.ftp_base), file.LName);
|
||||
MacroVars("fghi", "dsss", 0, outbuf, file.LName, "");
|
||||
area.Path+strlen(CFG.ftp_base), file.Name);
|
||||
MacroVars("fghi", "dsss", 0, outbuf, file.Name, "");
|
||||
}
|
||||
sprintf(outbuf, "%lu Kb.", (long)(file.Size / 1024));
|
||||
MacroVars("jkl", "ssd", StrDateDMY(file.FileDate), outbuf, file.TimesDL+file.TimesFTP+file.TimesReq);
|
||||
|
Reference in New Issue
Block a user