MCPcopy Create free account
hub / github.com/IoLanguage/io / IoFile_rawAsString

Function IoFile_rawAsString

libs/iovm/source/IoFile.c:562–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562IoObject *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
576IO_METHOD(IoFile, contents) {
577 /*doc File contents

Callers

nothing calls this directly

Calls 5

UArray_newFunction · 0.85
UArray_readFromFilePath_Function · 0.85
UArray_freeFunction · 0.85
IoState_error_Function · 0.85

Tested by

no test coverage detected