Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine file type/properties

Status
Not open for further replies.

TheObserver

Programmer
Mar 26, 2002
91
0
0
US
I'm using C, not C++. I was wondering if there was a library or some other method to determine if a supplied file name (user supplied argument) was an actual file name, or a directory.

Thanks for your time.
 
You should be able to use [tt]stat[/tt] on the user supplied path and use the [tt]S_ISREG[/tt] macro to find out if it's a regular file. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top