Page 1 of 1

Is it possible to delete a file on the harddrive?

Posted: June 16th, 2017, 3:59 am
by Matth
Hi

I am downloading satellite images and then show them in an animation/loop. That works normally fine until there is a download that is not working for whatever reason. In this case, it will keep the same image from 24 hours ago and the animation looks weird, as the image jumps 24 hours instead of just 10 minutes.

Is it possible to somehow delete the old file in case of an error? So basically to add an action at "OnDownloadErrorAction" to delete the file that should have been replaced?

Code: Select all

[RadarMeasure]
;Downloads the image every 10 minutes
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#rURL#
UpdateRate=2400
Download=1
DynamicVariables=1
DownloadFile="infrared\radar[MeasureHour][MeasureMin].png"
;Start displaying the images
FinishAction=[!EnableMeasureGroup "Images"][!UpdateMeasureGroup "Images"][!EnableMeasure "MeasureTimer"][!ShowMeterGroup "ImgDat"][!CommandMeasure "MeaFolder" "Update"]
OnDownloadErrorAction=[!EnableMeasureGroup "Images"][!UpdateMeasureGroup "Images"][!EnableMeasure "MeasureTimer"][!ShowMeterGroup "ImgDat"][!CommandMeasure "MeaFolder" "Update"]

Re: Is it possible to delete a file on the harddrive?

Posted: June 16th, 2017, 11:30 am
by mak_kawa
I am not sure if this method fits your purpose. But generally speaking, following measure deletes objective file silently by !CommandMeasure EraseFile "Run"

Code: Select all

[EraseFile]
Measure=Plugin
Plugin=RunCommand
Parameter=erase #FilePath#