| 560 | } |
| 561 | |
| 562 | IoObject *IoFile_rawAsString(IoFile *self) { |
| 563 | UArray *ba = UArray_new(); |
| 564 | |
| 565 | if (UArray_readFromFilePath_(ba, IoSeq_rawUArray(DATA(self)->path)) == 1) { |
| 566 | return IoState_symbolWithUArray_copy_(IOSTATE, ba, 0); |
| 567 | } else { |
| 568 | UArray_free(ba); |
| 569 | IoState_error_(IOSTATE, NULL, "unable to read file '%s'", |
| 570 | UTF8CSTRING(DATA(self)->path)); |
| 571 | } |
| 572 | |
| 573 | return IONIL(self); |
| 574 | } |
| 575 | |
| 576 | IO_METHOD(IoFile, contents) { |
| 577 | /*doc File contents |
nothing calls this directly
no test coverage detected