Hi Akira, > > The different behavior on win32 is due to the behavior of fopen(). > > fopen(dirname, "r") returns NULL on Windows, but returns a valid > > pointer on Unix file system. > Many thanks. I attach openclose.c.diff. > Please try that. Works perfectly (confirmed on OS X 10.11.6 x86_64-darwin). Thanks. Hironobu Yamashita