472,328 Members | 1,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Kepping Directory Permissions

I'm working on a program that takes files by path and moves them into
new locations, and then back again if the user intends. Everything is
great so far except I cannot figure out how to keep directory
permissions. File permissions are no problem, but when I try and put
a directory's permissions back, I, the user, lose all access to that
directory. When I give myself permission again, all my files have
kept their permissions. Here are some functions I am working with:

I have a File object that keeps the files original path, its new path
and permissions. When an instance is made of this object, it uses:
dirPath = os.path.dirname(filePath) to get the the files parent
directory. I get the directories permissions with this data calling
os.stat(dirPath)[0] and saving this value into an integer essentially.
When it comes time to move the file, I use os.renames() to put the
file into its new location, copy its permission's over and copy its
directories permissions over. It works for the file, but not for the
directories. Any ideas on how to save a directories permissions when
moved using renames()? Thank you.

-Tracy Tripp
Jul 18 '05 #1
0 1417

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bonehead | last post by:
Many thanks to all who replied to my previous post regaring proper installation of phpMyAdmin on unix/apache. Okay, I thought I had correctly...
4
by: Steven | last post by:
Does anyone know if there is a way to check the access permissions of different users using C#? I need to know if a user has full control or if...
0
by: Jeff Reed | last post by:
I am experiencing the the problem outlined the below. Unfortunately, I am using WinXP and I not sure if I can apply the solution due to lack of...
3
by: James Coleman | last post by:
Hello, The following error is appearing when attempting to create a directory using the availale system.io methods: ...
27
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx...
2
by: BLetts | last post by:
I have an ASP.NET app that must allow users to upload files. The files are stored in a virtual directory. I use Server.MapPath to map from the...
8
by: theWizard1 | last post by:
Using Asp.NET 1.1, and C#. I have a directory for the website, and a directory under it named Secure. I have a web.config in each of the above...
1
by: Aek | last post by:
What is the best way to recursively change the permissions of the directory we are installing into? Is there a nice way to do this in C# ..NET? ...
65
by: Hongyu | last post by:
Dear all: I am trying to write to a file with full directory name and file name specified (./outdir/mytestout.txt where . is the current...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.