Re: Programming question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Reedy

    Re: Programming question


    "Brad Navarro" <brad.navarro@w ni.comwrote in message
    news:31C3FE6222 74D44A8FE8E8D64 9AE178805E738D4 @exch1.wni.com. ..
    Basically, what I am trying to do is get a list of each file's
    attributes within a directory. Basically, the information that the 'ls
    -l' command would give you in a linux shell, except the results for each
    file in the directory are stored as a list.

    I am presently using version 1.5 on a linux machine. I have kindly
    requested my system administrator to upgrade to 2.5.2, but until then I
    am afraid I am stuck with 1.5.
    =============== ==============

    Our sympathies.

    Try
    os.popen("ls -l", 'r') # open a pipe to that command in read mode
    Then read line by line as you would with any other file.
    For append with file and info, append whatever to your list.

    tjr



Working...