added Mac OS X detection to fix fgetcsv behavior