Strange VMS bug

Peter Stockwell peter at sanger.otago.ac.nz
Sun Oct 1 14:41:12 EST 1995


Ewan Birney (birney at molbiol.ox.ac.uk) wrote:
> Dear bio-netters

> I'll probably cross post to VMS group as well, but I was wondering
> whether any of the VMS gurus knocking around this group could sort
> this one out:

I'm not a VMS guru (or any sort of guru really), but I remember big
problems with ftell & fseek under VMS (particularly if the fseek value
was not, in fact, an fseek return).

However, have you checked the return status of the fclose calls to
establish if the files are really being closed?  The code shown does not
examine the (int) return values.

Just a thought...

Peter A. Stockwell

> 	I am running a database searching program, which as I 
> scroll through the file I keep an ftell() index of sequence
> positions to re-open the file for alignments... I close
> the file fine but when I reopen it I get a NULL and the following
> error message in errno...

> "invalid default file name string address"

> I've traced the point at which I become unable to open the file to 
> write file opening: the actual code is

> (test_file is this database file.)

> #ifdef DEBUG_FILE
>                 log_full_error(INFO,0,"First test on %s - aln_file is %s",
> test_file,aln_file);
>                 if( (tmp=openfile(test_file,"R")) == NULL)
>                         log_full_error(INFO,0,"Was a bummer!");
>                 else    {
>                         log_full_error(INFO,0,"Openfile fine....");
>                         fclose(tmp);
>                         }                       
> #endif              

>                 if ( (ofp=openfile(aln_file,"W") ) == NULL)
>                         {
>                 log_full_error(WARNING,0,"Unable to open alignment file %s, no
> `
>                         }
> 		else	{                

> #ifdef DEBUG_FILE
>                         log_full_error(INFO,0,"Second test on %s",test_file);
>                         if( (tmp=openfile(test_file,"R")) == NULL)
>                                 log_full_error(INFO,0,"Was a bummer!");
>                         else    {
>                                 log_full_error(INFO,0,"Openfile fine....");
>                                 fclose(tmp);
>                                 }                       
> #endif

> 	The first test_file open is fine, the second is not.
> 	            
>                 
>         Now openfile is the interface between my code and fopen. The rules
> in openfile = 
> 	if( *prot is capital letter) switch on error calling and call fopen with
> 		smaller letter

> 	call fopen first

> 	if it is a read file
> 	try to append two (on UNIX machines setenv) different strings to
> 	the file so read files are looked for in a path
> 		current directory
> 		WISEPERSONALDIR
> 		WISECONFIGDIR

> Does anyone know what that error message means? Does anyone have an idea
> about why it is not working on VMS (BTW - there is no problem on any
> flavor of UNIX)

> any pointers ( ;) - been programming in C for too long) very wellcome...

> ewan birney

> birney at molbiol.ox.ac.uk





More information about the Bio-soft mailing list