in reply to Re^3: Correct code for deleting old file?
in thread Correct code for deleting old file?
Thanks a million. However that sounds like a complete rewrite would be ideal.
However I should point out that the scripts aren't mine (my programming expertise is with REALbasic), they are commercial (which might explain why they are so poorly documented) and I have basically no knowledge of Perl, I'm just the poor sucker who got stuck with setting up our new Mascot PC (the guy who did it the last time has long since left).
Our Mascot version is a few years old, so the database update script doesn't work right with the new databases (there have been some changes), so the script needed updating.
I managed to do most of the required changes, but there is an acknowledged bug in there in that a certain file (speclist.txt) needs to be replaced, however the download does not replace it, it just adds it to the folder (as speclist1, speclist2, etc). So their solution is that we should delete the file manually before running the script - yeah, right, who is going to remember that as (a) the script is run every month only, and (b) is being called automatically.
So I try to add a file deletion routine to the script:
# # delete old speclist # if ( $matchName eq "speclist.txt" ) { if (-e "$local_taxonomy_directory/speclist.txt") { # does the s +peclist file exist unlink("$local_taxonomy_directory/speclist.txt") #delete + it } else { &lastWords("Failed to delete original speclist"); } } #
but that doesn't seem to work and I don't know why ... yet
Thanks
Markus
|
|---|