I have a strange problem using ::fileutil::fileType. I have a file
exported from the Windows registry section [HKEY_LOCAL_MACHINE] and it
is about 121MB in size. When I run the ::fileutil::fileType on this
file it returns "binary audio mpeg". This is odd because this file is
plain text. However poking around the ::fileutil::fileType source code
I can **find** the characters that would trigger the file to be a binary
audio file. These characters are located deep within the exported file.
So I shortened the file to 121 KB (starting from the bottom-the top part
remained the same) and now ::fileutil::fileType returns "text".
Further poking into ::fileutil::fileType reveals that it defines a
buffer size of 1024 and then reads 1024 bytes into the buffer and
immediately closes the file. So I assume that it reads the first 1024
bytes to determine the file type.
Why is it behaving this way?
Thank you, Mike...
_______________________________________________
ActiveTcl mailing list
ActiveTcl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs