cxong / tinydir

Lightweight, portable and easy to integrate C directory and file reader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tinydir_file_open with filename only fails under Windows

cxong opened this issue · comments

commented

i.e. if tinydir_file_open is called with say "filename.txt" it will fail, but if it is called with "./filename.txt" it will succeed.

http://linux.die.net/man/3/dirname

If path does not contain a slash, dirname() returns the string "." while basename() returns a copy of path.

https://msdn.microsoft.com/en-us/library/e737s6tf.aspx

If the full path does not contain a component (for example, a filename), _splitpath assigns empty strings to the corresponding buffers.

So that's the reason.