LabWindows/CVI

Content Type
Programming Language
Current manual

GetFullPathFromProject

GetFullPathFromProject

int GetFullPathFromProject (char simpleFileName[], char fullPathName[]);

Purpose

Gets the full pathname for the file you specify, if the file is in the currently loaded project.

You can use GetFullPathFromProject when your program needs to access a file in the project and you do not know what directory the file is in.

In a stand-alone executable, GetFullPathFromProject assumes that the file is in the same directory as the executable file.

Example Code

char *fileName;
char fullPath[MAX_PATHNAME_LEN];
fileName = "myfile.c";
if (GetFullPathFromProject (fileName, fullPath) < 0)

FmtOut ("File %s is not in the project\n", fileName);

Note    LabWindows/CVI does not report run-time errors for GetFullPathFromProject.
Note    MAX_PATHNAME_LEN is only reliable for ANSI single byte strings. For UTF-8 strings, call the IsUTF8PathLengthValid function to confirm that the file path is within the operating system character limit.

Parameters

Input
Name Type Description
simpleFileName char [] The name of a file that is in the currently loaded project.

The name must be a simple filename and should not contain any directory paths. For example, file.c is a simple filename, whereas dir\file.c is not.
Output
Name Type Description

Return Value

Name Type Description
result int The result of the call.

Code Description
0 Success.
-1 Unable to find specified file in the project

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Was this information helpful?

Previous

GetModuleDir

Next

SetDir

Previous

GetModuleDir

Next

SetDir