Sunday, August 7, 2022

Deleting a file if file size exceeds a threshold size

I want to delete a dta file if its size is less than x kilobytes. I use the code below. The dta file in question is not less than x kilobytes but Stata still deletes it. Where am I going wrong?

Code:
checksum "data101201.dta"
rm "data101201.dta" if r(filelen) < x
return list


No comments:

Post a Comment