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 8466675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:24:40+00:00 2026-06-10T15:24:40+00:00

I am investigating ways to take a directory (folder) and derive some form of

  • 0

I am investigating ways to take a directory (folder) and derive some form of unique numerical identifier. I have investigated “string to hash” methods, however, the Pigeon Hole Principle means that one can never derive a truely unique number for every single string.

String to unique hash is no good.

I have recently been investigating other means of achieving my goal and thus have the following question to ask:

Directory time stamps – how ‘unique’ are they?
To what resolution are the time stamps reported by ‘stat’ as described here (second post)? if the resolution is small enough, is it possible for more than one folder to share the exact same time stamp on a Linux system?

If anyone has other methods/techniques they’d like to share, I’d be happy to listen 🙂

Edit 1 To clarify my use case in response to the answers posted so far: I am working on Android platforms, so the filesystem is not linked to any other (except of course for removeable media such as Micro SD cards).

I am inserting each path into a database but trying to avoid string comparisons when querying the table. The use of maps/hashmaps is not an option here. Yes, the path itself is unique, but ideally I need a numerical identifier that can be used to query the table as opposed to the path itself. The identifier must also be unique per path. I have experimented with std::collate but found there were many collides in the hashes (a dataset of 20, 000 paths yeilds approximatley 100 collides). What was even more surprising is that the hashes appeared to be largely different each time my application is run. I wonder if it’s seeded somehow?

Many thanks,
P

  • 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-06-10T15:24:42+00:00Added an answer on June 10, 2026 at 3:24 pm

    On any UNIX-based system, you can use the inode number as a unique identifier within that file system. Combining it with the device number will make it unique within the machine. If you wanted it to be globally unique, you could throw in the system’s primary MAC address.

    Keep in mind, however, that:

    1. The inode number will “follow” the directory if it is moved or renamed. It will change if the directory is deleted and replaced.

    2. The inode number will not be stable across systems, beyond one or two really special directories. (For instance, / is usually inode 2.)

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

Sidebar

Related Questions

I'm investigating ways of using GPU in order to process streaming data. I had
Previously I have been investigating several solutions how to register with email address instead
I have been investigating about creating a UDP server, at first i though i
Can you describe difference between two ways of string concatenation: simple __add__ operator and
I've currently investigating ways of improving our current c++ network hand-made serialization mechanism maintaining
I currently have 3 ways to play audio within my app: Using AudioServicesPlaySystemSound for
I'm investigating and performance testing various ways of randomizing ordered collections, and I was
I have recently been investigating java server-side web frameworks to serve as a rendering
I'm investigating the use of Azure Storage for an application I have in mind.
I have a string that may have whitespace characters around it and I want

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.