Comments (3)
Your source seems old and outdated, or has been modified from the original.
Current code is :
function FileSize(F: THandle): Int64;
var res: Int64Rec absolute result;
begin
result := 0;
if PtrInt(F)>0 then
res.Lo := GetFileSize(F,@res.Hi); // from WinAPI or SynKylix/SynFPCLinux
end;
from mormot.
Yes, it's strange because I just did a fossil clone
and fossil open
a few days ago (3 or 4), I'm puzzled, but after your reply I did a check on my repository and can see that the Lazarus tool when converted the SQLite3/Samples/12 - SynDB Explorer/DBSynLZ.dpr
has changed that line.
Sorry it was my fault and thank you again for your help.
fossil status
repository: /home/mingo/dev/lazarus/mORMot.fossil
local-root: /home/mingo/dev/lazarus/mORMot/
config-db: /home/mingo/.fossil
checkout: d34ccfc62edf0c594ad3afae25c36fa4b1d8c330 2022-02-28 08:01:23 UTC
parent: 91e09aae31fcbc74ac72ca141aa66c5edd2422c3 2022-02-03 11:41:09 UTC
tags: trunk
comment: {6366} updated static SQLite3 engine to latest 3.38.0 revision (user: ab)
MISSING SQLite3/SQLite3UI.RES
MISSING SQLite3/SQLite3UILogin.RES
EDITED SQLite3/Samples/01 - In Memory ORM/Project01.res
EDITED SQLite3/Samples/04 - HTTP Client-Server/Project04Client.res
EDITED SQLite3/Samples/04 - HTTP Client-Server/Project04Server.res
EDITED SQLite3/Samples/12 - SynDB Explorer/DBSynLZ.dpr
EDITED SQLite3/Samples/12 - SynDB Explorer/SynDBExplorer.dpr
EDITED SQLite3/Samples/12 - SynDB Explorer/SynDBExplorerMain.pas
EDITED SQLite3/Samples/ThirdPartyDemos/Ondrej/SynTaskDialog4Lazarus/SynTaskDialog.pas
EDITED SQLite3/mORMotUIEdit.pas
EDITED SQLite3/mORMotUILogin.pas
EDITED SQLite3/mORMoti18n.pas
EDITED SynCommons.pas
EDITED SynFPCMetaFile.pas
EDITED SynTaskDialog.pas
Here is the output of fossil diff
:
....
Index: SynCommons.pas
==================================================================
--- SynCommons.pas
+++ SynCommons.pas
@@ -1,10 +1,14 @@
/// common functions used by most Synopse projects
// - this unit is a part of the freeware Synopse mORMot framework,
// licensed under a MPL/GPL/LGPL tri-license; version 1.18
unit SynCommons;
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
(*
This file is part of Synopse framework.
Synopse framework. Copyright (C) 2022 Arnaud Bouchez
Synopse Informatique - https://synopse.info
@@ -96,11 +100,11 @@
{$endif HASINLINE}
{$endif LVCL}
{$ifndef NOVARIANTS}
Variants,
{$endif NOVARIANTS}
- SynLZ, // needed for TSynMapFile .mab format
+ SynLZ, FileUtil, // needed for TSynMapFile .mab format
SysUtils;
const
/// the corresponding version of the freeware Synopse framework
@@ -30602,11 +30606,11 @@
SetLength(result,Size+Read); // in-place resize
MoveFast(tmp,PByteArray(result)^[Size],Read);
inc(Size,Read);
until false;
end else begin
- Size := GetFileSize(F,nil);
+ Size := FileSize(F); { *Converted from GetFileSize* }
if Size>0 then begin
SetLength(result,Size);
P := pointer(result);
repeat
Chunk := Size;
@@ -30854,11 +30858,11 @@
res: Int64Rec absolute result;
begin
result := 0;
f := FileOpen(FileName,fmOpenRead or fmShareDenyNone);
if PtrInt(f)>0 then begin
- res.Lo := GetFileSize(f,@res.Hi); // from SynKylix/SynFPCLinux
+ res.Lo := FileSize(f); { *Converted from GetFileSize* } // from SynKylix/SynFPCLinux
FileClose(f);
end;
end;
{$endif MSWINDOWS}
@@ -30865,11 +30869,11 @@
function FileSize(F: THandle): Int64;
var res: Int64Rec absolute result;
begin
result := 0;
if PtrInt(F)>0 then
- res.Lo := GetFileSize(F,@res.Hi); // from WinAPI or SynKylix/SynFPCLinux
+ res.Lo := GetFileSize(F, nil); { *Converted from GetFileSize* } // from WinAPI or SynKylix/SynFPCLinux
end;
function FileInfoByHandle(aFileHandle: THandle; out FileId, FileSize,
LastWriteAccess, FileCreateDateTime: Int64): Boolean;
var
...
from mormot.
Don't let the Lazarus conversion wizard change your code or your .res files.
Just let it create the .lpi with the proper kind of application (e.g. console), then stop.
Or - even better - reuse an existing .lpi with some manual search&replace.
from mormot.
Related Issues (20)
- Correct criticalsection managment and move some declaration to handle HttpAPI in Windows. HOT 2
- Memory Leak on RemoteDB HOT 2
- Documentation example mistake ? 4.3.1. TList-like properties HOT 10
- Typo in SAD 1.18 HOT 3
- why cannot run the same SQLite on Linux at the same time HOT 1
- Bufferoverread for THttpServerRequest.FullUrl HOT 4
- ARM9 without FPU(VFP) does not support HOT 1
- Forward slash instead of backslash? HOT 3
- Fatal Error (Exception External:?) after second exception in Interfaced based Services HOT 1
- Declaration of "ConvertToEmfPlus" is not 64 bit safe HOT 1
- THttpApiWebSocketConnection.PrivateData Property value cannot be set. HOT 2
- THttpServer.OnHttpRequest - Ctxt.RemoteIP is empty HOT 2
- HttpGet: outStatus parameter is invalid
- THttpServer : Executing the HEAD request will read the entire file HOT 4
- TWinHTTP Thread safe issue in filling OSVersionInfo HOT 1
- Postgresql boolean (t/f) JSON parsing HOT 1
- Cannot compile under Delphi 12 due to the compiler errors HOT 2
- SynBloomFilter large volumes HOT 1
- more than one results in AggregateDoc() - MongoDB HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mormot.