suve

awful: function: file-get-contents

Available since rev.39 (v.0.5.3).

Declaration

ascii :file-get-contents ( string $PATH )

Summary

Reads a file from the disk and return its contents as an ASCII string. If unable to read file, returns NIL.

Example

# :f-get-contents example - UNIX cat replica
!if :not :param-num
    :writeln s'Usage: cat.yuk <filename> [filename] [...]'
    :exit
!fi
 
:set &idx i0
!while :lt $idx :param-num
    :write :file-get-contents :param-str $idx
    :add &idx i1
!done

wikipage modified on 2014/0611/1029