imatix / gsl

iMatix GSL code generator
http://www.imatix.com
GNU General Public License v3.0
538 stars 107 forks source link

Directory iteration multiple issues. #73

Open evoskuil opened 9 years ago

evoskuil commented 9 years ago

I'm encountering multiple problems attempting to use the latest build of GSL on Windows to enumerate files and/or directories.

Using the documentation as an example:

dir = directory.open(".", error_text) ?

if defined(dir)
  for dir.file as f
      echo "file:$(f.name) has size: $(f.size)"
  endfor
else
    abort "Error: " + error_text
endif

The run fails because f.name (and f.size) is undefined. But further trials also shows:

This last item is not technically a break, but would make portable code hard, because presumably this is a behavior specific to Windows. But note that other path references in GSL on Windows don't require forward slashing:

../libbitcoin/include  => x:\xxxxx\libbitcoin/
../libbitcoin/include/ => x:\xxxxx\libbitcoin/
../libbitcoin/include\ => x:\xxxxx\libbitcoin\include/

I'm really stuck at this point. I looked through the GSL source, but it's going to be a slog for me. Any help would be much appreciated!

evoskuil commented 9 years ago

I've located and resolved the last bullet item, just a case of hardwired "/" in some cases, where the code normalizes to the platform in other cases.

evoskuil commented 9 years ago

The other items are a consequence of UNICODE being defined. This implies that some code is issuing a UNICODE definition or API call.