Skip to content
Advertisement

Tag: path

How can I obtain a case sensitive path on Linux without directory iteration?

Given a mounted cifs file system /network/cifs which is case insensitive, how do I obtain the case sensitive path using C? For example, the fs has a file /network/cfis/Adena/t.txt. Given /network/cfis/AdEnA/T.txt (which properly resolves), I want /network/cfis/Adena/t.txt. I know one way to do it is to recursively iterate over the path, match them in all lower case, and get the

Check whether a path is absolute or relative

How do you check whether a path is absolute or relative, using C on Linux? Answer On Unix like systems (incl. Linux, macOS) If it starts with a slash it’s absolute, otherwise it’s relative. That is because everything is part of a single tree starting at the root (/) and file systems are mounted somewhere in this tree. On Windows

Advertisement