Hi, all.
I teach programming and a student really stumped me with this one. His program was generating a file with a space at the end of the name, like this: "test.txt ". I could not open this file with TextMate, only with OpenOffice. TextMate shows the file in the project drawer but when you click on it nothing happens. I finally figured it out by going to a terminal window and displaying the directory with a ls -a. It showed this up as "test.txt\ " and it started making sense. I could then track down the bug in my student's code.
Is this a known thing? I searched the list archives but didn't see this.
Thanks,
-Eric
On 28 Nov 2008, at 20:52, Eric Knapp wrote:
[...] It showed this up as "test.txt\ " and it started making sense. I could then track down the bug in my student's code.
Is this a known thing? I searched the list archives but didn't see this.
The space itself is not a problem, but the extension is then “txt ” which TM has never seen before, so it has to determine if the type is text or binary. If it is binary, it will not open if you just single- click it, but you can change that by right-clicking the file and educating TextMate.
The way it determines if it is text is, if the first 1024 contain valid UTF-8, so I assume your student is using some other (legacy) encoding.