<FromGitter>
<erdnaxeli:cervoi.se> that's seems to be what I am looking for, but it is complaining
<FromGitter>
<naqvis> what are you trying to achieve?
<FromGitter>
<erdnaxeli:cervoi.se> exactly what the example says: creating a type in a macro, then iterating over this type instance vars
<FromGitter>
<naqvis> you can use `@type` inside a macro to get the type
<FromGitter>
<erdnaxeli:cervoi.se> the macro is not executed inside the type, the macro is writing the code for the type
<FromGitter>
<naqvis> When a macro is invoked you can access the current scope, or type, with a special instance variable: @type. The type of this variable is TypeNode, which gives you access to type information at compile time.
<FromGitter>
<erdnaxeli:cervoi.se> well now it see no instance vars, but that's something different
<FromGitter>
<erdnaxeli:cervoi.se> btw I you have two macros calling each other recursively in a never ending loop, the compiler fails with an invalid memory access ^^
<FromGitter>
<naqvis> that seems like a design issue
<FromGitter>
<naqvis> I'm not that much into macros and always avoid them until they are really necessary
<FromGitter>
<naqvis> so would suggest to wait here, till other persons jump in and provide their valuable thoughts
<straight-shoota>
@Blacksmoke16 the blocking syscall to openat happens in Crystal::System::File.open and that is called from File.new
<FromGitter>
<Blacksmoke16> ah gotcha 👍
<straight-shoota>
the blocking property doesn't affect open
<yxhuvud>
ah. So what is necessary is to do the open using raw libc and pick out the fd from that and then create a FileDescriptor or the like?
Human_G33k has quit [Remote host closed the connection]
<straight-shoota>
yes
<straight-shoota>
that would do
<straight-shoota>
but I'm really not sure if a fifo with O_NONBLOCK is that useful
Human_G33k has joined #crystal-lang
Human_G33k has quit [Max SendQ exceeded]
Human_G33k has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
Human_G33k has quit [Quit: Leaving]
Human_G33k has joined #crystal-lang
astronavt has quit [Quit: ...]
riffraff169 has quit [Quit: Leaving.]
<FromGitter>
<Oblivious-Oblivious> Hi, how would I go about converting a LibC::Char** to an Array of Strings in Crystal ? ⏎ I found an old GitHub issue (2015) for initializing the pointer on an `Array.new` on that topic however I'm still getting back Pointers. ⏎ ⏎ Specifically I have this. ⏎ ... [https://gitter.im/crystal-lang/crystal?at=602d405e9ba13e72e436882b]
<FromGitter>
<Oblivious-Oblivious> Hi, how would I go about converting a LibC::Char** to an Array of Strings in Crystal ? ⏎ I found an old GitHub issue (2015) for initializing the pointer on an `Array.new` on that topic however I'm still getting back Pointers. ⏎ ⏎ Specifically I have this. ⏎ ... [https://gitter.im/crystal-lang/crystal?at=602d409de634904e60a6d96c]
<FromGitter>
<Oblivious-Oblivious> @naqvis Ok that gives a list of Strings thanks *
<FromGitter>
<naqvis> 👍
<FromGitter>
<naqvis> curious to know why you are utilizing FFI for functionality which already exists in stdlib? How your `get_directory_list` is different from `Dir#children or #glob etc`?
<FromGitter>
<Oblivious-Oblivious> I had a library for directory walking ready in C when I started the project, which was faster when I first tried it, but I'll probably switch to glob since with recent tests it seems to me glob is as fast as the C alternative.
<FromGitter>
<Blacksmoke16> and ofc the obvious question, is fastest possible speed a requirement? I.e. its prob not worth the extra complexity if not just to save like 500ms or whatever
<FromGitter>
<Oblivious-Oblivious> I am trying to write software for continuously monitoring hundreds of thousands of files and directories (basically for automatic cloud sync on multiple computers) so we are talking about saving minutes.
<FromGitter>
<Blacksmoke16> 👍 fair enough
<FromGitter>
<Oblivious-Oblivious> Ofc minutes is fine when mainly syncing code files but still
alexherbo2 has quit [Ping timeout: 260 seconds]
Human_G33k has quit [Remote host closed the connection]
<FromGitter>
<lirossarvet> Can anyone explain why the compiler complains about `path` being nil in this case? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I've done the check; is this just a natural limitation? Is there a way to...assert to the compiler "I promise it isn't `nil` here, please carry on"? [https://gitter.im/crystal-lang/crystal?at=602d6a5347585464db84f1ac]
<FromGitter>
<Blacksmoke16> pretty sure that should work, given you're assigning the value to local var first
<FromGitter>
<Blacksmoke16> would want to do like `if path = flags.manifest_path`
<FromGitter>
<lirossarvet> Ah geez, thanks. I thought I'd tried the local variable one but missed one somewhere, I guess.
Human_G33k has quit [Max SendQ exceeded]
<FromGitter>
<lirossarvet> Definitely very new to Crystal. Trying it out at our Ruby shop company as a compiled, shareable CLI for common stuff we do :D
<FromGitter>
<Blacksmoke16> 👍 nice
<FromGitter>
<Blacksmoke16> keep in mind if you're on mac you cant statically compile, so may need to install a few libs
<FromGitter>
<lirossarvet> Yeah. For the most part things have been fine cause we aren't doing crazy complex stuff, but definitely something to keep in mind :)
<FromGitter>
<Blacksmoke16> 👍
Human_G33k has joined #crystal-lang
alexherbo2 has joined #crystal-lang
eax has joined #crystal-lang
eax has left #crystal-lang [#crystal-lang]
sz0 has joined #crystal-lang
deavmi has quit [Ping timeout: 240 seconds]
deavmi has joined #crystal-lang
<FromGitter>
<perfecto25> hello, anyone aware of any crystal libs that can do multicast connectivity to mcast IP and port?
<FromGitter>
<perfecto25> trying to build a multicast listener that can connect to mcast group and port, do basic conectivity sanity check