Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard (or free) POSIX path manipulation C library

Is there any standard (or widely used) simple POSIX path manipulation library for C (path join, filename stripping, etc.) ?

Actually, because I'm mostly working under Windows, I currently use 'shlwapi' path functions.

Is there any equivalent set of functions available for POSIX paths?

like image 391
rotoglup Avatar asked Jan 17 '12 20:01

rotoglup


People also ask

What is a Posix path?

A path is represented by a number of path components separated by a path separator which is a / on POSIX systems and can be a / or \ on Windows. The root of the tree is represented by a / on POSIX and a drive letter followed by a / or \ on Windows (e.g. C:\ ). Paths can be absolute or relative.

Where is your C library?

Libaries consist of a set of related functions to perform a common task; for example, the standard C library, 'libc. a', is automatically linked into your programs by the “gcc” compiler and can be found at /usr/lib/libc. a. Standard system libraries are usually found in /lib and /usr/lib/ directories.


1 Answers

  • path join - snprintf()
  • filename stripping - dirname()
  • etc. - basename(), realpath(), readlink(), glob(), fnmatch()...
like image 133
John Zwinck Avatar answered Dec 20 '22 16:12

John Zwinck