Code: Select all
(removed because updated code posted later)
Code: Select all
(removed because updated code posted later)
odd, now it is back.roedygr wrote:There is a bug in the way you transform filename into names for the cache file. It collapses similar names onto one or for some reason does not build an entry for every file.
*
Code: Select all
/*********************
* Set $cachefolder in onBeforeMainStart() to the folder to use to store data (it must end in a backslash)
*********************/
function onBeforeMainStart() {
$cachefolder='T:\\cache\\';
}
function onTargetCanAdd() {
if !$otca_add return;
$cachefile=$cachefolder+replaceRegEx($otca_target,'[^a-zA-Z0-9\.\-\_]','_');
// ProgressMessage('$cachefile: '+$cachefile);
$cfinfo=getFileInfo($cachefile,1);
if $cfinfo.isSet() {
$tinfo=getFileInfo($otca_target,1);
if $tinfo.isSet() {
$otca_add=false;
if $tinfo.lastwrite_year>$cfinfo.lastwrite_year { $otca_add=true; }
else { if $tinfo.lastwrite_year==$cfinfo.lastwrite_year {
if $tinfo.lastwrite_month>$cfinfo.lastwrite_month { $otca_add=true; }
else { if $tinfo.lastwrite_month==$cfinfo.lastwrite_month {
if $tinfo.lastwrite_day>$cfinfo.lastwrite_day { $otca_add=true; }
else { if $tinfo.lastwrite_day==$cfinfo.lastwrite_day {
if $tinfo.lastwrite_hour>$cfinfo.lastwrite_hour { $otca_add=true; }
else { if $tinfo.lastwrite_hour==$cfinfo.lastwrite_hour {
if $tinfo.lastwrite_min>$cfinfo.lastwrite_min { $otca_add=true; }
}}}}}}}}
}
}
}
function onTargetProcessed() {
$cachefile=$cachefolder+replaceRegEx(getValueString(5),'[^a-zA-Z0-9\.\-\_]','_');
if getValueInt(1) || getValueInt(2) {
deleteFile($cachefile);
}
else {
writeFile($cachefile,'',2);
}
}
Sorry, I have no idea what's going on. Did you see the messages posted and then they disappeared or did you never see the messages posted? And are you sure you posted the message with 'Submit' and didn't accidentally just preview it?roedygr wrote:My recent messages have disappeared again.
Code: Select all
function onTargetProcessed() {
$cachefile=$cachefolder+replaceRegEx(getValueString(5),'[^a-zA-Z0-9\.\-\_]','_');
if getValueInt(1) || getValueInt(2) { // if has errors or warnings
deleteFile($cachefile);
}
else {
// writeFile($cachefile,'',2); // create an empty file
writeFile($cachefile,getValueString(5),2); // for debugging
}
}
Could the option to enable writeFile() have been reset to the default when you installed? New installations will have this option set to the default (which is disabled), or if you uninstalled a previous version and did a 'full uninstall'.roedygr wrote:I installed the 14.0300 version of HTMLValidator. My cache script has stopped working.