View Issue Details

IDProjectCategoryView StatusLast Update
0014360LazarusLCLpublic2019-05-08 12:55
ReporterFelipe Monteiro de CarvalhoAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformIntel Pentium 4OSMicrosoft WindowsOS VersionXP
Product VersionProduct Build 
Target VersionFixed in Version0.9.27 (SVN) 
Summary0014360: FileSize doesn't work in WinCE
DescriptionThe following code:

procedure TForm1.Button2Click(Sender: TObject);
begin
  if FileExists('\Storage Card\wince\gdb.exe') then Caption := 'Exists';
  Edit1.Text := IntToStr(FileSize('\Storage Card\wince\gdb.exe'));
end;

Shows that the file exists, but the result for FileSize is -1

Probably FindFirstFile doesnt return a correct size. The following code works:

var
  AHandle: THANDLE;
  Str: widestring;
begin
  Str := '\Storage Card\wince\gdb.exe';
  AHandle := Windows.CreateFileW(PWideChar(Str),
    GENERIC_READ, FILE_SHARE_DELETE or FILE_SHARE_READ or FILE_SHARE_WRITE,
    nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
  Edit1.Text := IntToStr(Windows.GetFileSize(AHandle, nil));
TagsNo tags attached.
Fixed in Revision21243
LazTarget0.9.28
Widgetset
Attached Files

Relationships

related to 0011572 closedFelipe Monteiro de Carvalho TOpenDialog, TSaveDialog: Don't work on WinCE-Widgetset 
related to 0035512 resolvedJuha Manninen winlazfileutils.inc patch 

Activities

Felipe Monteiro de Carvalho

2009-08-16 05:29

developer   ~0029898

Oh ... FileUtil is located in the LCL! For me it was just so natural that it would be in the RTL ... sorry, anyway, I think I already spoted the bug.

Could someone move this to the Lazarus part please? thanks

Gennadiy

2009-08-16 07:20

reporter   ~0029899

Last edited: 2009-08-16 07:21

Shouldn't you use FileSize only on the files opened by AssignFile/Reset/Rewrite?

Florian

2009-08-16 10:08

administrator   ~0029900

The FileSize of the RTL, yes.

Felipe Monteiro de Carvalho

2009-08-16 14:52

developer   ~0029906

I fixed it and also added support for unicode filenames in win32

Issue History

Date Modified Username Field Change
2009-08-16 05:20 Felipe Monteiro de Carvalho New Issue
2009-08-16 05:20 Felipe Monteiro de Carvalho FPCOldBugId => 0
2009-08-16 05:22 Felipe Monteiro de Carvalho Relationship added related to 0011572
2009-08-16 05:29 Felipe Monteiro de Carvalho Note Added: 0029898
2009-08-16 07:20 Gennadiy Note Added: 0029899
2009-08-16 07:21 Gennadiy Note Edited: 0029899
2009-08-16 10:08 Florian Note Added: 0029900
2009-08-16 10:08 Florian Project FPC => Lazarus
2009-08-16 14:36 Felipe Monteiro de Carvalho LazTarget => 0.9.28
2009-08-16 14:36 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2009-08-16 14:36 Felipe Monteiro de Carvalho Status new => assigned
2009-08-16 14:36 Felipe Monteiro de Carvalho Category RTL => LCL
2009-08-16 14:52 Felipe Monteiro de Carvalho Fixed in Revision => 21243
2009-08-16 14:52 Felipe Monteiro de Carvalho Status assigned => resolved
2009-08-16 14:52 Felipe Monteiro de Carvalho Fixed in Version => 0.9.27 (SVN)
2009-08-16 14:52 Felipe Monteiro de Carvalho Resolution open => fixed
2009-08-16 14:52 Felipe Monteiro de Carvalho Note Added: 0029906
2011-12-01 11:22 Marc Weustink Status resolved => closed
2019-05-08 12:55 Juha Manninen Relationship added related to 0035512