CONTENTS | INDEX | PREV | NEXT

 fdtofh

 NAME
  fdtofh - return AmigaDOS file handle for file descriptor

 SYNOPSIS
  BPTR fh = fdtofh(fd);
  int fd;

 FUNCTION
  Returns the AmigaDOS file handle associated with a file descriptor
  or NULL if the file descriptor is illegal or simulated.  You may then
  make AmigaDOS library calls using the file handle

 EXAMPLE

  #include <exec/types.h>

  main()
  {
      BPTR fh;

      write(1, "FuBarn", 6);

      if (fh = fdtofh(1))
      Write(fh, "FuBarn", 6);

      return(0);
  }

 INPUTS
  int fd;     file descriptor

 RESULTS
  BPTR fh;    associated file handle or NULL