0

I read a mf4 file using asammdf package. I want to delete this file after doing some edits but failed. The error shows: This file is in use by another program and cannot be accessed by the process. I wonder how to close a mf4 file before delete.

from asammdf import MDF
mdf = MDF(path)

YT Q
  • 31
  • 4

1 Answers1

1
from asammdf import MDF
mdf = MDF(path)
# .... something something
mdf.close()
danielhrisca
  • 665
  • 1
  • 5
  • 11
  • I didn't find mdf.close() but use another one: mdf.__del__() to correctly close this file. – YT Q Jan 24 '22 at 03:17
  • I struggled with it as I filtered my mdf `mdf0 = mdf0.filter(channels)` before closing it and this did not work. But it works if you do not change the mdf file reference before closing, thanks! – flipSTAR Jun 09 '22 at 07:35