mcandre / rez

C/C++ task runner
Other
3 stars 1 forks source link

add example pure C project #31

Closed mcandre closed 2 years ago

mcandre commented 2 years ago

Need to find a suitable pure C alternative to the portable filesystem library.

mcandre commented 2 years ago

Maybe libuv

https://conan.io/center/libuv

http://docs.libuv.org/en/v1.x/fs.html

Unfortunately, any third party dependency makes task runners more difficult to write. We would have to find a way to integrate the additional include and linker directories into the rez.{c,cpp} compilation command.

mcandre commented 2 years ago

Good news, basic filesystem things are accessible via some (hidden and disabled by default) POSIX functions. A few manual wrapper utility functions are necessary to provide practically high level semantics for these operations.

Instead of C++ std::map, we can use a slower, linear associative array by scanning through all the elements in an array of keys (strcmp) and using the corresponding index (if any) to get the value from an array of values. That's not scalable, but most projects don't define more than a few dozen build tasks.

Tracking a small C example in branch "issue-31".

mcandre commented 2 years ago

Yuck, MSVC C (non C++) options are limited in COMSPEC Windows.

https://docs.microsoft.com/en-us/windows/win32/fileio/file-systems

https://stackoverflow.com/questions/4180351/unable-to-delete-a-folder-with-shfileoperation/4180426

TODO: