eclipse-ecal / fineftp-server

📦 C++ FTP Server Library for Windows 🪟, Linux 🐧 & more 💾
MIT License
311 stars 64 forks source link

Support for SIZE command and cross-compilation on Linux to Windows #28

Closed bjuulp closed 2 years ago

bjuulp commented 2 years ago

This pull request adds support for the SIZE command. Preliminary support for cross-compilation on Linux to Windows is also added. See the example CMake toolchain file. There are some issues wrt support for wstring in the fstream constructor when cross-compiling with GCC 7.5.0. I've therefore had to disable the UTF8 supporting code in 1 place. The changes have been tested on Windows (based a cross-compiled exe built on Linux), only.

FlorianReimold commented 2 years ago

I have merged the changes to a branch and will now check whether I can resolve the mingw issue that you wrote about. mingw is a compiler that we try to support at least a little bit, so it would be nice if UTF8 support works for that.

bjuulp commented 2 years ago

Thanks. I'm not sure the current use of std::ftream can deal with this. I think we will have to go directly on the Win32 API to solve this for both mingw and msvc. But that may be needed for another reason, too: I'd like to see memory mapped files being used instead in order to increase speed and reduce pressure on memory. I have a working example in some other FTP server code I have created. That could potentially refactored to fit into the fineftp-server as well, although it will take some time for me to do that. I'm rather busy now, but will see if I can get that done within a month or so.

FlorianReimold commented 2 years ago

I am not sure either, but I will try anyways. If you have already running code for memory mapped files I will be happe to accept another PR 😊