Click here to Skip to main content
15,894,017 members
Articles / Desktop Programming / MFC
Article

FPATH - Search files in Environment's Directories

Rate me:
Please Sign up or sign in to vote.
3.27/5 (8 votes)
14 Mar 20032 min read 56.5K   1.4K   14   6
An utility to search files in Environment's Directories

Introduction

After 25 years of programming, I have accumulated a vast array of tools especially command line oriented tools.  One such tool is FPATH.EXE which I used constantly on a daily basis. There is no way I can be productive without it.

What does FPATH do?

Well, its like a "WhereIS" utility but instead, it is designed to search the paths or directories defined in your environment table. For C/C++ programmers, the following three (3) environment strings are used:

  • PATH - Defines the directories for executables, batch files, etc.
  • INCLUDE - Defines the directories for your C/C++ include files (*.H files)
  • LIB - Defined the directories for your C/C++ Library files (*.LIB files)

For Delphi programmers (at least up to 3.0 which is when I last used it), the units and includes directories are defined in the DCC32.CFG file.  FPATH will search this file as well! Another concept that FPATH helps with is figuring out the extension of a file. Here are some every day examples one may go through:

Where is the windows.h file?

D:\src>fpath windows.h
[path]
[include]
6334     05/23/2001 23:38:46 \program files\microsoft sdk\include\windows.h

In this case, it was found in the INCLUDE environment string in the SDK include directory, which is expected.

I heard about this program, MSDEV, where is it?

D:\src>fpath msdev
[path]
270406   06/17/1998 04:00:00  \vstudio\common\msdev98\bin\msdev.exe 

In this case, no extension was provided because I don't know what it is.  FPATH found it in the PATH with an extension of EXE.   FPATH will try BAT, CMD, COM and EXE which is the order the OS command line interpreter will load files (Note: This was true in early 90's when FPATH was designed).

Hmmm, I downloaded this .NET program and it failed because its looking for MSCOREE.DLL. Do I have it?

D:\src>fpath mscoree.dll
[path]
[include]
[lib]
[wcinclude]
[wclib]

In the case, it wasn't found. FPATH search the above environment strings. WCINCLUDE and WCLIB are our directories for our wcBASIC compiler used for our product Wildcat! Interactive Net Server (http://www.santronics.com)

If you want to define your own group of environment strings to search, then set the FPATH environment string.

Anyway, I think you get the idea. The source to FPATH is included. Enjoy.

Hector Santos, CTO
Santronics Software, Inc.

History

  • V3.5P - Initial Public Release

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionUsing fpath.exe in a PHP script? Pin
Ttech25-Jan-07 6:07
Ttech25-Jan-07 6:07 
GeneralHelp with accessing folder Pin
vgandhi13-Jun-03 8:42
vgandhi13-Jun-03 8:42 
GeneralDrive letter missing Pin
Patje16-Mar-03 21:00
Patje16-Mar-03 21:00 
GeneralRe: Drive letter missing Pin
hector santos17-Mar-03 0:58
hector santos17-Mar-03 0:58 
GeneralWell, search file in the specified domain. Pin
Anonymous15-Mar-03 16:54
Anonymous15-Mar-03 16:54 
GeneralRe: Well, search file in the specified domain. Pin
hector santos17-Mar-03 1:00
hector santos17-Mar-03 1:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.