Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/File Management    [ Add a report in this area ]  
Report #:  105161   Status: Closed
TDirectory.IsEmpty return value is wrong
Project:  Delphi Build #:  XE, XE2
Version:    16.4 Submitted By:   Stefan Glienke
Report Type:  Basic functionality failure Date Reported:  4/25/2012 7:04:53 AM
Severity:    Serious / Highly visible problem Last Updated: 9/5/2012 7:50:46 PM
Platform:    All versions Internal Tracking #:   28247
Resolution: Fixed (Resolution Comments) Resolved in Build: : 17.0.4625.53395
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
If you call TDirectory.IsEmpty for an empty drive (where it does not have the . and .. folders) it returns False.
This is because the local variable Empty is never initialized because the delegate where it gets set is never called.

Empty should be initialized with True
Steps to Reproduce:
If you call TDirectory.IsEmpty for an empty drive (where it does not have the . and .. folders) it returns False.
---------------
program QC105161;

{$APPTYPE CONSOLE}

uses
  IOUtils;

const
  EmptyDrive = 'F:\';
begin
  if TDirectory.IsEmpty(EmptyDrive) then
    Writeln('PASS')
  else
    Writeln('FAIL');
  Readln;
end.
---------------
Workarounds
None
Attachment
None
Comments

Tomohiro Takahashi at 5/17/2012 7:29:22 PM -
This report was opened with valid Internal Tracking Number.
Thanks.

Server Response from: ETNACODE01