|
12:18
lizmat left,
lizmat joined
14:50
Geth left
16:27
Geth joined
|
|||
| [Coke] | "rak thing dir" - no match. "rak thing dir/file" -path specification did not select any files. - but the file exists, and has this string in it. | 17:12 | |
| is there a way to generate debug output so I can see why it's not finding it? | 17:13 | ||
| lizmat | --rak | 17:55 | |
| [Coke] | Path specification did not select any files, paths: [".\\config\\my-file.json"], dir .\config\my-file.json - it's there. | 18:03 | |
| might it think it's not a text file? | 18:04 | ||
| from the readme: just before it isi being called. | 18:06 | ||
| small typo | |||
| if I explicitly add "--extensions=json", it finds it. | 18:07 | ||
| lizmat | is it a very small file ? | ||
| also: is it readable? | 18:08 | ||
| [Coke] | 2960L, 103967B | ||
| "type path/to/file" works. | 18:09 | ||
| I can vi it | |||
| (this is windows) | |||
| rak can read it fine if I use --extensions=json | |||
| I don't have a .rak-config.json in my home dir on this windows box | 18:13 | ||
| lizmat | hmmm... wonder if it is somehow Windows related... | ||
| [Coke] | any reason why the first run of 'rak thing dir' might be significantly slower than future calls? | 18:15 | |
| Guessing it has to be the is-text= true default | 18:16 | ||
| yah, specifying "extensions" doesn't show is-text then in --rak | 18:17 | ||
| I also do not see that I opened this as an issue previously. You're using a module for the "is-text" check, I'm guessing? | 18:18 | ||
| lizmat | what does: use path-utils; say path-is-text("config/my-file.json") | ||
| say? | |||
| [Coke] | 0 | 18:19 | |
| lizmat | ok, so it considers it to be binary | ||
| assuming the path is correct | 18:20 | ||
| maybe the file has a BOM? and that triggers it ? | |||
| also the test assumes it's UTF-8 or ASCII | |||
| any 16bit encoding would probably also consider it binary | 18:21 | ||
| [Coke] | vi -b shows no BOM | ||
| it does show a ^M per line... | |||
| I'll figure out what in the algo is causing the fail | 18:22 | ||
| lizmat | it *is* open source... :-) a PR for path-utils would be brill | 18:26 | |
| [Coke] | Having this all be in NQP makes debugging hard. | 18:29 | |
| Oh. looking at just comments: | 18:36 | ||
| # \r not followed by \n hints binary | |||
| ... that is not true for windows | |||
| lizmat | no? | ||
| [Coke] | ... ah, whoops, it's expected to be \r\n windows, \n linux. oops | 18:38 | |
| lizmat | yeah, old pre-OSX macs only had \r only | ||
| [Coke] | got it. You are trimming the buffer *first*, then checking to see if the \r is followed by an \n. | 18:43 | |
| ... and in this file, guess what the buffer ends on. | |||
| Just happens to be split at the magic 4096 mark. | 18:44 | ||
| if I change it to 4095, it says it's text | 18:45 | ||
| or, more importantly, 4097. | |||
| opened a ticket. | 18:47 | ||
| path-utils #3 | |||
| lizmat | ah, cool. thanks! | ||
| [Coke] | \o/ | 18:48 | |
| lizmat | line 88 in path-utils: | 18:55 | |
| if you change that to: my int $limit = nqp::elems($buf) -1; | |||
| does it accept it then? (I think it should) | |||
| [Coke] | af(that)k right now, will check later and report back | 19:18 | |