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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:51:26+00:00 2026-05-25T22:51:26+00:00

I am currently working on a server. I’ve created my own directory but need

  • 0

I am currently working on a server. I’ve created my own directory but need access to files located in a different directory on the server. Basically, I have code that needs access to the files located in another directory on the server but I do not know how to go about doing this. Is there a command in my code that I can add or is there something on the command line i can type? The error I get in my code looks like this:

[aburac1][mcbbigram][/ruths/data/aburac1] python get-contribs.py
Traceback (most recent call last):
  File "get-contribs.py", line 96, in <module>
    fec_files = filter(lambda x: x.endswith('.fec'),os.listdir(dname))
OSError: [Errno 2] No such file or directory: '1001015'

The file 1001015 is located in the directory /ruths/data/fec/efr. So how do I get access to those files from my directory?

  • 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-25T22:51:26+00:00Added an answer on May 25, 2026 at 10:51 pm

    You can specify the whole path when you enter a file name. For example, say you want to open a file “foo.txt” in the directory “/home/docs”. You could run the command:

    f = open("/home/docs/foo.txt")
    

    where f is now a handle for your file. Alternatively, the command os.chdir from the module os changes the current working directory. The following snippet has the same effect as above:

    import os
    os.chdir("/home/docs")
    f = open("foo.txt")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on migrating an application from MS-Access to MS SQL Server. In
The code I am currently working on runs on Windows Server 2003, but needs
I am currently working on a registration based website, and I have the server
i am currently working on importing data from excel sheet to sql server.i have
I'm currently working with parsing some data from SQL Server and I'm in need
I am currently working on a server control for other applications in our company
I'm currently working on several custom ASPX server controls. Of course these controls do
I'm currently working on a Silverlight application connected to a SQL Server 2008 Express
I am currently working with 2 sql 2000 servers one I can query but
I am currently working on server application that has to deal with reasonable amount

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.