Is there a possibility to obtain filename from file handle? Or how can I delete file having only a handle?
To achieve this, you will need to create a wrapper that stores the file name. A file handle has no context of the filename it was created from.