Link to home
Start Free TrialLog in
Avatar of rainette
rainette

asked on

'findfirst' in Borland C++ for Win32

  The 'findfirst' function (Borland C++ 5.02,Borland C++ Builder) returns WRONG results of file date and file time
when called for FA_LABEL attribute, i.e to detect disk's label. The same function used in 16 bit environment returns
correct results for both date and time.
   How could I in 32 bit program written in Borland C++ detect true date & time of disk label ? Perhaps I could do it in assembler subroutine ? Perhaps there are other functions to do it ?
by assembler subroutine
ASKER CERTIFIED SOLUTION
Avatar of Answers2000
Answers2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rainette
rainette

ASKER

Thank you, but the indicated functions do not give information on LABEL attribute (I've just consulted Borland HELP). I'll try nevertheless.  The best method would be to call a 16 bit
program (DOS application) but I am not able to prohibit DOS screen to appear (redirection
of stdout goes but this screen appears nevertheless). Do you know if this is possible ?
In Win32, FindFirstFile does not return the disk label. GetVolumeInformation returns it, but no date and time information.
Just in case someone else comes across this, you can get the Date and Time of the file from the correct conversion of the Time attribute of the TSearchRec:

TSearchRec sr;

FindFirst(path, iAttributes, sr);

ShowMessage(path + "," +
                        DateTimeToStr(FileDateToDateTime(sr.Time)) + "," +
                        IntToStr(sr.Size));