Extract base path from a pathname in C

后端 未结 8 1773
南笙
南笙 2020-12-30 14:21

Question

How do you extract the base path from pathname in C?

Are there any functions built into the C language or the C-Runtime L

8条回答
  •  伪装坚强ぢ
    2020-12-30 15:00

    In Windows you can use the API call "PathRemoveFileSpec" http://msdn.microsoft.com/en-us/library/bb773748(v=vs.85).aspx

    Cross platform solutions will not really be possible due to variations in file systems bewtween different OS's.

提交回复
热议问题