It is currently March 28th, 2024, 9:56 am

Is it possible to delete a file on the harddrive?

Get help with creating, editing & fixing problems with skins
Post Reply
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Is it possible to delete a file on the harddrive?

Post 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"]
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

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

Post 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#
Post Reply