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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read, write, execute 1

Status
Not open for further replies.

joeGrammar

Programmer
Jun 4, 2001
162
CA
Hey guys,

I'm curious if there is a way in MSVC++ to determine if a file is read-only write-only or executable? Any help would be great. Thanks
 
use GetFileAttributes John Fill
1c.bmp


ivfmd@mail.md
 
To determine if it is an executable file use the following ShellApi function
(#include ShellApi.h and use Shell32.lib)


SHGetFileInfo and pass it a SHGFI_EXETYPE flag.
If the return value is 0, then the file is not executable. else it will have a specufic return value for the EXE type(header) Windows PE, Dos Executabile etc.

For more info check the MSDN,

Hope this helps s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top