Using autoexec.py to delete files from temp folder on startup

Hi, i can manually delete files in my osmc .kodi folder by using ssh at command line:
rm .kodi/temp/*.fi

I want to automate this at startup and have added an autoexec.py file to my .kodi/userdata folder

import os
myfile="/.kodi/temp/*.fi"

## if file exists, delete it ##
if os.path.isfile(myfile):
    os.remove(myfile)
else:    ## Show an error ##
    print("Error: %s file not found" % myfile)

On reboot the files are not deleted

Could someone help ?

Your path to the folder is not correct.
Rather than /.kodi it should be something like /usr/osmc/.kodi - but double check from command line to be sure.

I’ve resolved my issue with a revised autoexec.py:

import glob
for fl in glob.glob("home/osmc/.kodi/temp/*.fi"):
    os.remove(fl)