Programming question

Terry Reedy tjreedy at udel.edu
Wed Jun 11 19:08:22 EDT 2008


"Brad Navarro" <brad.navarro at wni.com> wrote in message 
news:31C3FE622274D44A8FE8E8D649AE178805E738D4 at 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






More information about the Python-list mailing list