fread and fwrite are part of J
fread
3 : 0
if. 1 = #y=. boxopen y do.
1!:1 :: _1: fboxname y
else.
1!:11 :: _1: (fboxname {.y),{:y
end.
:
x freads y
)
fwrite
4 : '(,x) (#...@[ [ 1!:2) :: _1: fboxname y'
2010/12/23 Steven Taylor <[email protected]>
> Hi,
>
> I'm having a few challenges reading / writing files. I seem to be able to
> write them okay, but reading one back in gives me a string (do I need a
> cast?).
>
> I have been using some of Devon's definitions (haven't worked out how to
> use
> "load 'jfiles'" yet. Also, examples from
> http://www.jsoftware.com/help/user/component_files.htm wiki were failing
> here).
>
> Some of Devon's definitions:
>
> fopen=: [:1!:21<
>
> fclose=: [:1!:22<
>
> fwrite=:1!:2
>
> thanks,
>
> -Steven
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Björn Helgason, Verkfræðingur
Fornustekkum II
781 Hornafirði,
t-póst: [email protected]
gsm: +3546985532
sími: +3544781286
http://groups.google.com/group/J-Programming
Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
góður kennari getur stigið á tær án þess að glansinn fari af skónum
/|_ .-----------------------------------.
,' .\ / | Með léttri lund verður |
,--' _,' | Dagurinn í dag |
/ / | Enn betri en gærdagurinn |
( -. | `-----------------------------------'
| ) | (\_ _/)
(`-. '--.) (='.'=) ♖♘♗♕♔♙
`. )----' (")_(") ☃☠
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm