Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:21:33+00:00 2026-05-27T17:21:33+00:00

Given a mounted cifs file system /network/cifs which is case insensitive, how do I

  • 0

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 actual case returned by the directory iteration. However, this involves a lot of syscalls that I would rather not do.

Changing the mount options is not a solution.

If this is not possible, is it possible to determine if a path is on a case insensitive file system? This way I could avoid doing recursive directory iteration unless required.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:21:34+00:00Added an answer on May 27, 2026 at 5:21 pm

    That question just came up last night in IRC; my answer was you have to iterate, and the reason is that getcwd (which may be implemented by just looking at /proc/N/ files in Linux) is not reliable to determine the canonical name. The Linux CIFS kernel module will fake up inodes on the fly with the casing that you asked for:

    ls -dli /mnt/foo /mnt/foO /mnt/fOo /mnt/FOo /mnt/FOO
    

    can show very different values, and as such, /proc/self/cwd will reflect one of these inodes, not necessarily the one with the canonical naming.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given an absolute or relative path (in a Unix-like system), I would like to
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
Given a path to a file or directory, how can I determine the mount
Given a (source) patch file, what's the easiest way to apply this patch on
Given a path, in Mac OS X, is there a way to tell that
I'm looking for a way to get the .dmg path of a mounted disk
I'm using Python 2.6 on Linux. What is the fastest way: to determine which
I'm running Amazon EBS based small instance. This is how my file system looks
Given p(0,0) , how do I retrieve points{(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1),(-1,0),(-1,1)} which are the perimeter points relative
Given a specific DateTime value, how do I display relative time, like: 2 hours

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.