Search for a file

Discussion in 'Python' started by mithuna g, Jun 10, 2004.

  1. mithuna g

    mithuna g Guest

    Hi All,

    I am new user of python. I would like to have your suggestions to do a task.

    Given a file name say a.c, is there any possiblity that will help in finding the location of the file.

    Thanks,
    mithuna


    ---------------------------------
    Do you Yahoo!?
    Friends. Fun. Try the all-new Yahoo! Messenger
     
    mithuna g, Jun 10, 2004
    #1
    1. Advertising

  2. Am Thu, 10 Jun 2004 02:33:15 -0700 schrieb mithuna g:

    > Hi All,
    >
    > I am new user of python. I would like to have your suggestions to do a task.
    >
    > Given a file name say a.c, is there any possiblity that will help in
    > finding the location
    > of the file.


    Hi,

    If you use unix try "locate". If locate
    is not installed, try "find / -name 'a.c'"

    If you want to do this in python, have
    a look at os.listdir(). You need a recursive
    function since you want to search in sub-directories,
    too.

    Or try os.path.walk()

    Regards,
    Thomas
     
    Thomas Guettler, Jun 10, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?=

    Google search result like site search!! How?

    =?Utf-8?B?TGFrc2htaSBOYXJheWFuYW4uUg==?=, May 5, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    679
    Lucas Tam
    May 6, 2005
  2. Andy
    Replies:
    1
    Views:
    360
    Jack Klein
    Nov 25, 2003
  3. Anand Pillai

    String search vs regexp search

    Anand Pillai, Oct 12, 2003, in forum: Python
    Replies:
    10
    Views:
    600
    Anand Pillai
    Oct 15, 2003
  4. mason66
    Replies:
    0
    Views:
    424
    mason66
    Jul 27, 2006
  5. Abby Lee
    Replies:
    5
    Views:
    414
    Abby Lee
    Aug 2, 2004
Loading...

Share This Page