Searching on google, there are several utilities that one can install to fix this metadata problem. However, I was not the administrator of this computer as it was in a lab setting. Here was a nifty solution.
I had already created several files from this program (Groups and Graphs). Using a hexeditor I verified that the 'kind' information is definitely stored in the filesystem, and was not based on the contents of the files at all. If I couldn't change the metadata, I figured I could copy the contents (but not the entire file object) of the file into a file that did have correct metadata. Here's how this worked. I had a file, old-good-file, of the correct type that opened. My new file that wouldn't open was called new-bad-file.
Then in a shell I ran,
cp old-good-file new-good-fileThis way the contents of new-bad-file were moved to new-good-file without changing the metadata of new-good-file. new-good-file inherited its metadata from old-good-file. Now new-good-file works perfectly!
dd if=new-bad-file of=new-good-file
No comments:
Post a Comment