[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I pass a file pointer to my octfile?

From: baba
Subject: How do I pass a file pointer to my octfile?
Date: Wed, 22 Sep 2010 15:59:40 -0700 (PDT)

Hi all,

I am trying to pass a file id to my octfile function. In my octave script I

fid = fopen( filename, 'w');

then I would like to be able to call my oct function this way:

myOctFunction( fid, someDataToWrite);

>From code snippets I have read I can guess that my oct file should look
something like:

DEFUN_DLD(fann_save_fd,args, , )
    const octave_base_value& rep = args(0).get_rep();
    const FILE* fp = ((const FILE*)rep);


I am not sure what rep is ... I am guessing it is a generic pointer to the
argument's content?
Is that a proper way to do it?

Also I have read that you can do type checking using calls like
args(0).is_string() and such, but I have not found a place where all of the
available functions are described. (the closest I have seen is ov.h). For
instance I havent seen a function like is_file_id or equivalent.

any help or pointers to posts tutorials etc is welcome,


View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]