From 16fa171e95bacc7260b8622c9c7dfa46d578dceb Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Wed, 8 Jun 2022 18:48:40 -0230 Subject: [PATCH] Detect file size in FSNodeWINDOWS. --- src/windows/FSNodeWINDOWS.cxx | 7 +++++++ src/windows/FSNodeWINDOWS.hxx | 1 + 2 files changed, 8 insertions(+) diff --git a/src/windows/FSNodeWINDOWS.cxx b/src/windows/FSNodeWINDOWS.cxx index 10f63e01c..1bbfb1fd1 100644 --- a/src/windows/FSNodeWINDOWS.cxx +++ b/src/windows/FSNodeWINDOWS.cxx @@ -228,6 +228,13 @@ bool FilesystemNodeWINDOWS:: return true; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +size_t FilesystemNodeWINDOWS::getSize() const +{ + struct _stat st; + return _stat(_path.c_str(), &st) == 0 ? st.st_size : 0; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool FilesystemNodeWINDOWS::makeDir() { diff --git a/src/windows/FSNodeWINDOWS.hxx b/src/windows/FSNodeWINDOWS.hxx index df1abb82f..af2eca064 100644 --- a/src/windows/FSNodeWINDOWS.hxx +++ b/src/windows/FSNodeWINDOWS.hxx @@ -70,6 +70,7 @@ class FilesystemNodeWINDOWS : public AbstractFSNode bool makeDir() override; bool rename(const string& newfile) override; + size_t getSize() const override; bool getChildren(AbstractFSList& list, ListMode mode) const override; AbstractFSNodePtr getParent() const override;