[Info-vax] Request description of UFS for VMS person

G Cornelius cornelius at eisner.decus.invalid
Thu Apr 23 16:39:22 EDT 2009


Bob Eager wrote:
> On Tue, 21 Apr 2009 19:24:18 UTC, billg999 at cs.uofs.edu (Bill Gunshannon)
> wrote:

>>>Hmmm....my FreeBSD systems allow one to 'cat' a directory, as I would 
>>>expect.

>>What version?  Mine did in the past but I just tried it and it failed
>>on a directory.  I run mostly FreeBSD here.  No Solaris currently in
>>operation.  Not even at home.

> 6.3 on this one. Also tried 6.4. Don't have a 7.x system handy.

[...]

Output on a Linux system (Debian 'Sarge', ext3 fs), using
a trivial getc()/putc() program to copy a binary file:

 bash$ kernelversion
 2.6
 bash$
 bash$ ./copfile mydir junk.bin
 Error from getc(): Is a directory
 Completion status from getc() 0xffffffff errno 21
 Nonzero ferror(infile): 1

It would appear to be inherent in the I/O systems / RTL's
these days.

Program follows below.

-- George Cornelius

/* copfile.c
 */
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

extern void errabo();

FILE *infile,*oufile;
char str[1024];

main(argc,argv)
int argc;
char **argv;
{
  int c;
  int esave=0;
  if (--argc>0) {
    infile=fopen(*++argv,"rb");
    if (infile==NULL) errabo("Open failure on input file errno %d\n",errno);
    }
  else
    infile=stdin;
  if (--argc>0) {
    oufile=fopen(*++argv,"w");
    if (oufile==NULL) errabo("Open failure on output file errno %d\n",errno);
    }
  else
    oufile=stdout;

  while( (c=getc(infile)) >= 0 )
    putc(c,oufile);
  esave=errno;
  if (esave!=0)
    perror("Error from getc()");
  fprintf(stderr,"Completion status from getc() 0x%08x errno %d\n"
    ,c
    ,esave
    );
  if ( (c=ferror(infile)) != 0 )
    fprintf(stderr,"Nonzero ferror(infile): %d\n",c);

}
void errabo(string,errcode)
char *string;
int errcode;
{
  fprintf(stderr,string,errcode);
  exit(1);
}



More information about the Info-vax mailing list