Re: Accessing windoze file attributes

2010-09-16 Thread Douglas
@Dave Grateful thanks for your web site suggestions, and I will look them up. @Lawrence Pleasee accept my apologies. I mistook your brevity for a superior snotty attitude. -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing windoze file attributes

2010-09-16 Thread Dave Angel
On 2:59 PM, Douglas wrote: @Diez and @David Thanks guys. Both excellent leads. Colour me happy. I can now make progress and meet some deadlines. :) @Lawrence Why reinvent rsync? In what way is rsync relevant to the stated problem? Did you actually READ the question? Note: I use Linux at hom

Re: Accessing windoze file attributes

2010-09-15 Thread Lawrence D'Oliveiro
In message , Douglas wrote: >> Why reinvent rsync? > In what way is rsync relevant to the stated problem? Did you actually > READ the question? Yes. > Note: I use Linux at home (yes, even rsync) and very much prefer it to > Windows. However, at work I have no choice but to use the resources > t

Re: Accessing windoze file attributes

2010-09-15 Thread Douglas
@Diez and @David Thanks guys. Both excellent leads. Colour me happy. I can now make progress and meet some deadlines. :) @Lawrence > Why reinvent rsync? In what way is rsync relevant to the stated problem? Did you actually READ the question? Note: I use Linux at home (yes, even rsync) and very mu

Re: Accessing windoze file attributes

2010-09-15 Thread Lawrence D'Oliveiro
In message <8dc0fa8e-f0e6-4603-9283-186551597...@a19g2000vbi.googlegroups.com>, Douglas wrote: > It works well enough, but now I want to make it sensitive to the "A" > attribute (only backup the file if it is set), and update it > afterwards (unset it). This will help me avoid wasted disk due to

Re: Accessing windoze file attributes

2010-09-15 Thread David Robinow
This will help me avoid wasted disk due to > needless backups. > I have searched the inter-web and not found any info on how to do > access/alter Windows file attributes. > Please can someone direct me to a web page with suitable info > (preferably with code snyppyts)? http://code.

Re: Accessing windoze file attributes

2010-09-15 Thread Diez B. Roggisch
-web and not found any info on how to do > access/alter Windows file attributes. > Please can someone direct me to a web page with suitable info > (preferably with code snyppyts)? No windows nowhere here, but os.stat should be your friend. Diez -- http://mail.python.org/mailman/listinfo/python-list

Accessing windoze file attributes

2010-09-15 Thread Douglas
found any info on how to do access/alter Windows file attributes. Please can someone direct me to a web page with suitable info (preferably with code snyppyts)? Many thanks, in advance. -- Douglas -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross-platform module that creates directory object with all file attributes

2010-07-13 Thread python
Hi Tim, > Can't help you with x-platform; but for Windows I can offer my winsys package. > if f.readonly: >print f.created_at, f I like your logical model - that's exactly what I was looking for. Thank you for sharing your code. Cheers, Malcolm -- http://mail.python.org/mailman/listinfo/

Re: Cross-platform module that creates directory object with all file attributes

2010-07-13 Thread Tim Chase
On 07/13/2010 10:56 AM, pyt...@bdurham.com wrote: Any recommendations for a cross-platform module that creates a directory object with not only file names, but file attributes as well? Use cases: - Sort files by file size or date last modified - Filter files by read-only status I know I can

Cross-platform module that creates directory object with all file attributes

2010-07-13 Thread python
Any recommendations for a cross-platform module that creates a directory object with not only file names, but file attributes as well? Use cases: - Sort files by file size or date last modified - Filter files by read-only status I know I can use various standard library functions [1] to

Re: "Cloning" file attributes and permissions

2007-04-13 Thread Kevin Kelley
This is what I (just now) put together as an example: from os import stat,mknod,chown def match_perms(org_fname,new_fname): # Get information on old file st = stat(org_fname) st_mode = st.st_mode st_uid = st.st_uid st_gid = st.st_gid # Create the new file mknod(new_fname,st

Re: "Cloning" file attributes and permissions

2007-04-13 Thread Kevin Kelley
If you know what the permissions are going to be then you can use umask to set the default file creation permissions to match. Then any files created in that directory will have the correct permissions. I think the "pythonic" way to solve this problem would be to code up your own module which han

Re: "Cloning" file attributes and permissions

2007-04-12 Thread Paulo da Silva
[EMAIL PROTECTED] escreveu: > On Apr 12, 5:19 pm, [EMAIL PROTECTED] wrote: >> On Apr 12, 4:09 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: >> ... > > After poking around a bit I also discovered the > shutil module. It looks like you can use > shutil.copy2. More Pythonic, yes? > I have seen t

Re: "Cloning" file attributes and permissions

2007-04-12 Thread attn . steven . kuo
On Apr 12, 5:19 pm, [EMAIL PROTECTED] wrote: > On Apr 12, 4:09 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: > (snipped) > > > import subprocess > retcode = subprocess.call([ "/bin/cp", "-p", oldfile, newfile ]) > On my system, this preserves the access permissions and ownership. > > And if you m

Re: "Cloning" file attributes and permissions

2007-04-12 Thread attn . steven . kuo
On Apr 12, 4:09 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] escreveu: > > > > > On Apr 12, 9:20 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: > >> Hi! > > >> I need to process a file to produce another file that *must* have > >> *exactly* the same attributes and permissions of

Re: "Cloning" file attributes and permissions

2007-04-12 Thread Paulo da Silva
[EMAIL PROTECTED] escreveu: > On Apr 12, 9:20 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: >> Hi! >> >> I need to process a file to produce another file that *must* have >> *exactly* the same attributes and permissions of the former. What is the >> best way to do this? The file must not exist with

Re: "Cloning" file attributes and permissions

2007-04-12 Thread attn . steven . kuo
On Apr 12, 9:20 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: > Hi! > > I need to process a file to produce another file that *must* have > *exactly* the same attributes and permissions of the former. What is the > best way to do this? The file must not exist with contents (it may exist > empty) un

Re: "Cloning" file attributes and permissions

2007-04-12 Thread Kevin Kelley
The os module has this ability: http://docs.python.org/lib/os-file-dir.html -- Kevin Kelley On 4/12/07, Paulo da Silva <[EMAIL PROTECTED]> wrote: Hi! I need to process a file to produce another file that *must* have *exactly* the same attributes and permissions of the former. What is the best

"Cloning" file attributes and permissions

2007-04-12 Thread Paulo da Silva
Hi! I need to process a file to produce another file that *must* have *exactly* the same attributes and permissions of the former. What is the best way to do this? The file must not exist with contents (it may exist empty) unless it has the same attributes and permissions. I know how to do this us

Re: File attributes

2006-05-22 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I know how to "walk" a folder/directory using Python, but I'd like to > check the archive bit for each file. Can anyone make suggestions on > how I might do this? Thanks. > You must have Mark Hammond's win32 package installed, then you can (barely tested): import win3

Re: File attributes

2006-05-22 Thread Ben Cartwright
Ben Cartwright wrote: > [EMAIL PROTECTED] wrote: > > I know how to "walk" a folder/directory using Python, but I'd like to > > check the archive bit for each file. Can anyone make suggestions on > > how I might do this? Thanks. > > > Since the archive bit is Windows-specific, your first place to

Re: File attributes

2006-05-22 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: > I know how to "walk" a folder/directory using Python, but I'd like to > check the archive bit for each file. Can anyone make suggestions on > how I might do this? Thanks. Since the archive bit is Windows-specific, your first place to check is Mark Hammond's Python for

File attributes

2006-05-22 Thread acatejr
I know how to "walk" a folder/directory using Python, but I'd like to check the archive bit for each file. Can anyone make suggestions on how I might do this? Thanks. -- http://mail.python.org/mailman/listinfo/python-list