There are no "files in memory". There is only data in memory, loaded from some files. It would make sense if the data was handled as a file object in memory. But it isn't. There is one exception: textures. you can determine the names of textures a brush is using (see SaveB3D in the code archives).
Other than that you always know the filename since it was you who defined it before you called any loading command.
Other than that you always know the filename since it was you who defined it before you called any loading command.