GlibC and glob.h

You have an issue: The glob.h on osx does not match the swift docker glob.h.

As a result any developer compiling and testing locally before moving to the docker linux compiler cannot write for one platform.

Even the apple developer documentation is documenting a different header file.

This is fundamental, I dont want to fill command line applications with lots of #ifdef when processing files and directories. (or write a new class to patch over this)

Surely you can sync glibc with the berkley c files sitting on osx ?

Who is "you" that you are referring to? glob.h and the functions it describes are not the first pain points you are going to see between System V Unix(the basis for Linux) and BSD Unix. Having had to deal with these inconsistencies since the '80s, I think too much time has passed and too much code has been written for there to ever be a consistent definition.

Best bet is to define a interface for your package that you want, and implement it with all #ifs that are needed. It doesn't even need to be in Swift; you could write it in C and tailor the interface for easy integration with Swift callers.

exactly: really tediously and not “swift”

working around this anyway.
you is anyone trying to do deal with this

I think that's why most folks are using Foundation for file and directory operations, since most of it's been ported to Linux, and is pretty consistent between Linux and Darwin, where they overlap (not everything in Foundation has been ported yet to Linux).

Terms of Service

Privacy Policy

Cookie Policy