Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I know that the folder's attribute is _A_SUBDIR in C++.Is Other file has attribute too? such as , .txt or .exe...
Posted

1 solution

Hi,

tha attribute _A_SUBDIR comes from C++ CRT. If you are developing for Windows, you had better use Windows API functions and corresponding constants - see e.g. MSDN File Attributes Constants.

Back to your question, I think there is no such attribute for EXE file or TXT files. But you can distinguish them by their suffix (.exe, .txt, ...). For some of these files (not all) thare are special validation rules, that you have to check to see if the content inside is really that of the file type. E.g. There is such a check for EXE files - when trying to excecute an EXE file, OS check validation rules to see if it is a valid EXE file - these rules are described in the PE file Specification.

Hope this helps.

Best regards,
J.K.
 
Share this answer
 
Comments
RHsoul 17-May-13 3:20am    
You are very kind! Thank you very much!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900