igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Re: shared library error


From: Gábor Csárdi
Subject: Re: [igraph] Re: shared library error
Date: Thu, 27 Jan 2011 10:12:46 +0100

On Thu, Jan 27, 2011 at 10:07 AM, sergiu netotea
<address@hidden> wrote:
[...]
>    ifile=fopen(F1, "r");
>    igraph_read_graph_edgelist(&g1,ifile,ng1,dir);
[...]
> Perhaps igraph should have a way of telling if the file was not opened
> correctly although igraph cannot replace a programmer's bad practice.

There is such a way, provided by the standard C library. You should
check the return value of fopen():

RETURN VALUES
     Upon successful completion fopen(), fdopen(), and freopen() return a FILE
     pointer.  Otherwise, NULL is returned and the global variable errno is
     set to indicate the error.

Gabor

> Thanks,
> Sergiu
>

-- 
Gabor Csardi <address@hidden>     UNIL DGM



reply via email to

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