summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-08-22 13:48:20 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2010-08-22 13:48:20 +0200
commit95a19394a4a584eb6e71d4047a07b16f16416d37 (patch)
tree16c2bb42fa9b51ffcc17d03678f996b0efa94bac /src/corelib/x11
parentd9a8635bbb6271e934795ee2125f60a061c4ea62 (diff)
downloadfpGUI-95a19394a4a584eb6e71d4047a07b16f16416d37.tar.xz
Introduced a new cross-platform fpgFileSize() helper function.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/fpg_utils_impl.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/x11/fpg_utils_impl.inc b/src/corelib/x11/fpg_utils_impl.inc
index d8625b8c..908f411a 100644
--- a/src/corelib/x11/fpg_utils_impl.inc
+++ b/src/corelib/x11/fpg_utils_impl.inc
@@ -1,7 +1,7 @@
{%mainunit fpg_utils.pas}
uses
- Unix;
+ Unix, BaseUnix;
// X11 specific filesystem implementations of encoding functions
@@ -40,3 +40,11 @@ begin
fpSystem(Helper + ' ' + aURL + '&');
end;
+function fpgFileSize(const AFilename: TfpgString): integer;
+var
+ st: baseunix.stat;
+begin
+ if not fpstat(pointer(AFilename),st) >= 0 then
+ exit(-1);
+ Result := st.st_size;
+end;