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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:13:35+00:00 2026-06-18T11:13:35+00:00

Basically I have a FileExplorer class written in Python 2.6. It works great, I

  • 0

Basically I have a FileExplorer class written in Python 2.6. It works great, I can navigate through drives, folders, etc.
However, when I get to a specific folder ‘C:\Documents and Settings/.*’*, os.listdir, on which my script is based, throws this error:

WindowsError: [Error 5] Access is denied: ‘C:\Documents and Settings/.‘

Why is that? Is it because this folder is read-only? Or is it something Windows is protecting and my script cannot access?!

Here is the offending code(line 3):

def listChildDirs(self):
    list = []
    for item in os.listdir(self.path):
        if item!=None and\
            os.path.isdir(os.path.join(self.path, item)):
            print item
            list.append(item)
        #endif
    #endfor
    return list
  • 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-18T11:13:36+00:00Added an answer on June 18, 2026 at 11:13 am

    In Vista and later, C:\Documents and Settings is a junction, not a real directory.

    You can’t even do a straight dir in it.

    C:\Windows\System32>dir "c:\Documents and Settings"
     Volume in drive C is OS
     Volume Serial Number is 762E-5F95
    
     Directory of c:\Documents and Settings
    
    File Not Found
    

    Sadly, using os.path.isdir(), it will return True

    >>> import os
    >>> os.path.isdir(r'C:\Documents and Settings')
    True
    

    You could have a look at these answers for dealing with symlinks in Windows.

    • Create NTFS junction in Python
    • Symlinks in windows
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically have the following class: .sf-sub-indicator { background: url(/abcprod/images/arrows-ffffff.png) no-repeat -10px -100px; }
I basically have a class within another class (child). I'm trying to get the
I basically have several divs each with ids id_1, id_2 id_3 etc. The divs
I basically have a web-browser control that is going through and automatically completing some
I basically have: Public Class Job: MyBaseClass { public virtual string JobInformation {get;set;} ...
I basically have an object, extended with a function through its prototype. Inside that
I basically have two child classes which have the same parent class. what I
Basically have many huge delimited files that I know I can import as a
I basically have this markup coming from my JSP. I add class in each
Basically have been trying to set the wallpaper through a location based app. WallpaperManager

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.