Hi
Is it possible to check if a graphics file (glm etc) is corrupted before trying to open it. For some strange reasons some of my graphics files get corrupted and when I tried to open them my program crushes. Any advice will be appreciated.
Ibi
Corrupt files
Re: Corrupt files
Ibi,
Files get corrupt when something bad happened to PC or you have pulled out a USB stick without stopping it. Windows tries to close files nicely even if there was an exception.
You can do some quick checks. I never had to do it so far. One which comes to mind is to check file size. Corrupt files often have zero size. I just have checked: An empty .glm file has 264 bytes size
There is some header information in .glm which is same in all .glm. I need to check. It is probably at least 100 bytes. So you can create a utility to check for that.
A .glm can get corrupt at any place though. So the most reliable way is to load it in a KC sample. It is pretty easy to create a utility, which loads and unloads all .glm in a folder with catching exceptions
Nick
Files get corrupt when something bad happened to PC or you have pulled out a USB stick without stopping it. Windows tries to close files nicely even if there was an exception.
You can do some quick checks. I never had to do it so far. One which comes to mind is to check file size. Corrupt files often have zero size. I just have checked: An empty .glm file has 264 bytes size
There is some header information in .glm which is same in all .glm. I need to check. It is probably at least 100 bytes. So you can create a utility to check for that.
A .glm can get corrupt at any place though. So the most reliable way is to load it in a KC sample. It is pretty easy to create a utility, which loads and unloads all .glm in a folder with catching exceptions
Nick
Re: Corrupt files
Thank you Nick for your help
I have another question, not related to the problem (or may be related?).
I will post it separately
Ibi
I have another question, not related to the problem (or may be related?).
I will post it separately
Ibi