I'm not sure what you are expecting this to do. You can't fwrite to a Julia stream object, nor does that appear to be the C signature of fwrite. You seem to have a lowercase void there, which is causing the Julia error, although I suspect you will get a segfault if that typo wasn't there.
However, instead, call the Julia "write" function, and let dispatch do the right thing. On Thu, Feb 19, 2015 at 2:13 PM Kuba Roth <[email protected]> wrote: > Hi there, > Can somebody give me a hand debugging the following ccall please? > I have run out of ideas how to provide arguments. None of below work and > give: > ERROR: error interpreting ccall argument tuple > in anonymous at no file > > a = Uint8[] > append!(a,[1,2,3]) > z = open("myfile", "w") > ccall( (:fwrite, "libc"), Int32, (Ptr{Void}, Int32, Int32, Ptr{void},), a, > 1, 3, z) > ccall( (:fwrite, "libc"), Int32, (Ptr{Void}, Int32, Int32, Ptr{void},), a, > 1, 3, z.ios) > > > Also I'm not sure if I need to pass IOStream or Array (z.ios) to the ccall > > Much appreciate your suggestions. > Thank you, > Kuba
