How can I tell if a given path is a directory or a file? (C/C++)

后端 未结 7 1469
误落风尘
误落风尘 2020-12-08 13:22

I\'m using C and sometimes I have to handle paths like

  • C:\\Whatever
  • C:\\Whatever\\
  • C:\\Whatever\\Somefile

Is there a way to ch

7条回答
  •  春和景丽
    2020-12-08 13:45

    In Win32, I usually use PathIsDirectory and its sister functions. This works in Windows 98, which GetFileAttributes does not (according to the MSDN documentation.)

提交回复
热议问题