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!

System call for file properties?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is it possible to pull the properties (e.g. LastModifiedDate, FirstGeneratedDate, FileSize) from a file using C/C++?
 
Use 'stat' or 'fstat' defined in sys/stat.h.

If you want implement your program only for
Windows, use GetFileInformationByHandle if
you have a Windows file handle.
Use GetFileAttributesEx if you have a file
name. Hee S. Chung
heesc@netian.com
 
Use the following APIs:
- GetFileTime
- FileTimeToSystemTime
- CompareFileTime
- FileTimeToLocalFileTime

They are using FILETIME and SYSTEMTIME structures that contain the information you required.

Hope this helps, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
also GetFileSize John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top