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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:44:27+00:00 2026-05-22T19:44:27+00:00

Does anyone know what the complexity of the os.path.exists function is in python with

  • 0

Does anyone know what the complexity of the os.path.exists function is in python with a ext4 filesystem?

  • 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-22T19:44:28+00:00Added an answer on May 22, 2026 at 7:44 pm

    Underlying directory structure used by Ext4 (and Ext3) is exactly the same as in Ext2. Ext3 adds journaling, Ext4 improves that journaling. Journaling is irrelevant to your question.

    Originally Ext2 used to store that as list, but that of course was inefficient for large directories. So it’s has been changed to tweaked version of B-tree called HTree. Unlike standard B-tree, HTree has constant depth and uses hash-map per node, thus it’s lookup complexity is O(1).

    Ext2’s scheme, which we dubbed
    “HTree”, uses 32-bit hashes for keys,
    where each hash key references a range
    of entries stored in a leaf block.
    Since internal nodes are only 8 bytes,
    HTrees have a very high fanout factor
    (over 500 blocks can be referenced
    using a 4K index block), two levels of
    index nodes are sufficient to support
    over 16 million 52-character
    filenames. To further simplify the
    implementation, HTrees are constant
    depth (either one or two levels). The
    combination of the high fanout factor
    and the use of a hash of the filename,
    plus a filesystem-specific secret to
    serve as the search key for the HTree,
    avoids the need for the implementation
    to do balancing operations.

    See: http://ext2.sourceforge.net/2005-ols/paper-html/node3.html

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

Sidebar

Related Questions

Does anyone know what the complexity is for the SQL LIKE operator for the
Does anyone know of a FOSS Python lib for generating Identicons ? I've looked,
does anyone know about some good sources about counting complexity of recursive algorithms? somehow
Does anyone know how to calculate the complexity of a nested binary search tree?
Does anyone know the function of the command vmware-vim-cmd vimsvc/connect (vimid). I thought that
Does anyone know how to get IntelliSense to work reliably when working in C/C++
Does anyone know how to transform a enum value to a human readable value?
Does anyone know of a good Command Prompt replacement? I've tried bash/Cygwin, but that
Does anyone know of any existing packages or libraries that can be used to
Does anyone know a good Java lib that will hook into SVN so I

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.