How to read a directory path from a txt file

Samuel Kamau wachkama at gmail.com
Mon Jun 2 11:13:23 EDT 2014


On Monday, June 2, 2014 10:18:25 AM UTC-4, Samuel Kamau wrote:
> I have created a txt file with various paths to directories. The paths look like this
> 
> /home/wachkama/Desktop/api/genshi
> 
> /home/wachkama/Desktop/www/portal/schedule
> 
> /home/wachkama/Desktop/show/help.genshi
> 
> 
> 
> How do i read this paths in python ?

I have permission issues with my web server. So I have written part of my script to read and write the current paths in the web servers with its username and group name into a txt file. I want my script to replace the new permissions on my web server with the permissions written on my txt file. So The last part of my script is the tricky part. How to read the txt file and go to all the paths and rewrite the permissions as per what is on the txt file.



More information about the Python-list mailing list