IsTextFile←{
⍝ ⍵ ←→ Filename
o←'Records' 64
t←⍵ ⎕NTIE 0
11::1⊣⎕NUNTIE t
92::0⊣⎕NUNTIE t
≢⎕NUNTIE t⊣(⎕CSV⍠o)t
}
No doubt there are shorter, better solutions. We could trap ⎕NGET, but I don't want to read the whole file as it could be large (I could have sworn ⎕NGET was enhanced to read X number of records, but that appears not to be the case).
No doubt there are also solutions using ⎕NREAD, but I think ⎕CSV is doing alot of work under the covers to determine the type of text file the thing is, so maybe its useful here.
Any solutions or hint or tips appreciated.