Borland C++ reference

parsfnm

raw OCR

Parses file name.

Defined in header <dos.h>

Syntax

#include <dos.h>
char *parsfnmCconst   char *cmdline, struct fcb *fch, int opt);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

parsfnm parses a string pointed to by cmdline for a file name. The string is normally a command line. The file name is placed in a file control block (FCB) as a drive, file name, and extension. The FCB is pointed to by fcb.

The opt parameter is the value documented for AL in the DOS parse system call. See your DOS reference manuals under system call 0x29 for a description of the parsing operations performed on the file name.

Return value

On success, parsfnm returns a pointer to the next byte after the end of the file name. If there is any error in parsing the file name, parsfnm returns null.

Example

#include <process.h>
#include <string.h>
#include <stdio.h>
#include <dos.h>

int main (void)
{
   char line [80];
   struct fob blk;

   /* get file name  */
   printf ("Enter drive and file name (no path - ie. arfile.dat) \n");
   gets(line) ;

   /* put file name  in fob */
   if  (parsfnmdine,  &blk, 1) == NULL)
      printf ("Error in parsfm call\n");
   else
      printf ("Drive #%d  Name: %lls\n", blk.fcb_drive, blk.fcb_name) ;
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.