#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    206
    Rep Power
    12

    Request cvs data


    Hi,

    I want to write a program that returns all file that have been commited after a certain date.

    I walk through the path with os.path.walk and tried to invoke something like:
    Code:
    os.execl("c:\\cvs\\cvs.exe", "cvs", "log", file)
    The problem now is that the program does not return after executing os.execl

    Is there an other possiblity to do that?

    TIA
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    14
    Check out popen in the same os module or the popen2 module or the subprocess module (Python 2.4).

    grim
    Last edited by Grim Archon; June 22nd, 2005 at 06:20 AM. Reason: misspelt Python!
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    206
    Rep Power
    12
    Originally Posted by Grim Archon
    Check out popen in the same os module or the popen2 module or the subprocess module (Python 2.4).

    grim
    Now I tried something like:
    Code:
      f = os.popen(cvsExe + "log " + file, "w")
      f.read()
    The process now returns but I get an error message:
    Code:
        f.read()
    IOError: [Errno 9] Bad file descriptor
    How can I read what the cvs returns?
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    206
    Rep Power
    12
    Originally Posted by Wizard2003
    Now I tried something like:
    Code:
      f = os.popen(cvsExe + "log " + file, "w")
      f.read()
    The process now returns but I get an error message:
    Code:
        f.read()
    IOError: [Errno 9] Bad file descriptor
    How can I read what the cvs returns?
    I found a solution:
    Code:
    p = subprocess.Popen([cvsExe, "log", file, stdout=subprocess.PIPE)
    cvsResult = p.communicate()[0]

    Comments on this post

    • CyBerHigh agrees

IMN logo majestic logo threadwatch logo seochat tools logo