PathIsFileSpecPathIsFileSpec*
*



Contents  *



Index  *Topic Contents
*Previous Topic: PathIsDirectory
*Next Topic: PathIsHTMLFile

PathIsFileSpec


BOOL PathIsFileSpec(
    LPCTSTR lpszPath
    );

Searches a path for any path delimiting characters (for example, ':' or '\' ). If there are no path delimiting characters present, the path is considered to be a File Spec path.

lpszPath
Address of the path to be searched.

Example:

#include <windows.h>
#include <iostream.h>
#include "Shlwapi.h"

void main( void )
{

    // Path 1 string.
	char buffer_1[] = "sample"; 
	char *lpStr1;
	lpStr1 = buffer_1;

	// Path 2 string.
	char buffer_2[] = "C:\\TEST\\sample"; 
	char *lpStr2;
	lpStr2 = buffer_2;

	//Return value from "PathIsFileSpec".	
	int	retval;	

	// Test path 1 for file spec.
	retval = PathIsFileSpec(lpStr1);
	cout << "The path to verify file spec is     : " << lpStr1 << endl;
    cout << "PathIsFileSpec returns TRUE and is  : " << retval << endl;
    
	// Test path 2 for file spec.
	retval = PathIsFileSpec(lpStr2);	
	cout << "\nThe path to verify file spec is     : " << lpStr2 << endl;
	cout << "PathIsFileSpec returns FALSE and is : " << retval << endl;

}
OUTPUT:
==============
The path to verify file spec is     : sample
PathIsFileSpec returns TRUE and is  : 1

The path to verify file spec is     : C:\TEST\sample
PathIsFileSpec returns FALSE and is : 0

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.