comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: call_external (IDL5.5)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: call_external (IDL5.5) [message #29497 is a reply to message #29496] Mon, 25 February 2002 05:19 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Reimar Bauer wrote:
>
Hi,
I give an example:

The following compiled and used by idl5.4.1 works fine and IDL5.5 got's
a memory fault.

IDL> PRINT,call_external('my_stat.so.linux','uid','file.txt',/i_v alue)



/*
Linux:
gcc -fPIC -Wall -g -c my_stat.c
gcc -g -shared -W1,-soname,my_stat.so.0 -o my_stat.so.linux my_stat.o
-lc
*/

#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>

typedef struct {
unsigned short slen;
short stype;
char *s;
} IDL_STRING;

double uid(int argc, void *argv[])
{
/* returns the user-id of the file */
struct stat s;
int rcode;
IDL_STRING path;
char buf[1023];
long uid;


path=*(IDL_STRING *) argv[0];
strcpy(buf,path.s);
buf[path.slen]='\0';

rcode=stat(buf,&s);

uid=s.st_uid;

return(uid);

}


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL books?
Next Topic: Re: Satellite orbit procedure

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 10:23:26 PDT 2025

Total time taken to generate the page: 1.68350 seconds