I find myself having to check within a script whether a download via '/tool fetch' successfully finished. It seemed easiest to store the current time/date via '/system clock get time' and '/system clock get date', try to fetch the file and compare its creation-time, but despite the documentation claiming that the type of that attribute is 'time', on 3.28 I find that it's a string instead:
Code: Select all
/system script> :put ("timestamp is " . [/file get [/file find name=test.txt] creation-time] . " and typeof creation-time is " . [:typeof [/file get [/file find name=test.txt] creation-time]]);
timestamp is aug/10/2009 16:46:03 and typeof creation-time is str
Or am I overlooking a far simpler method to detect whether the download successfully finished?
Thanks,
Felix