Patches item #1490190, was opened at 2006-05-17 13:45 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1490190&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Modules Group: Python 2.5 >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: M. Levinson (levinsm) Assigned to: Neal Norwitz (nnorwitz) Summary: add os.chflags() and os.lchflags() where available Initial Comment: The return value from os.stat() includes st_flags on some systems, but currently there's not much that can be done with the value; this patch aims to make st_flags useful by adding some associated constants to stat.py and the corresponding chflags() and lchflags() functions in posixmodule. For completeness, shutil.copystat() is also updated to call os.chflags() where it's available. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2007-02-19 11:56 Message: Logged In: YES user_id=21627 Originator: NO Thanks for the patch. Committed as r53826. ---------------------------------------------------------------------- Comment By: M. Levinson (levinsm) Date: 2006-05-19 13:47 Message: Logged In: YES user_id=1522893 In addition to MacOS, chflags(2) is available on FreeBSD, OpenBSD, and NetBSD. The flags in Lib/stat.py are the full set of available values although, as you noted, MacOS hasn't (yet) implemented several of them. Thanks for the comments - I've attached an updated version of the patch incorporating your suggestions. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2006-05-19 09:31 Message: Logged In: YES user_id=33168 What operating systems is this available on? The only one I've found is OS X. The man page says it's from BSD 4.4. I tried on Linux of various flavors (4+), Solaris, and Tru64. None of them had chflags. I also could only find some of the flags in my sys/stat.h that were added to stat.py. stat.h didn't have UF_NOUNLINK, SF_NOUNLINK, SF_SNAPSHOT. As far as the patch itself, it looks good. There are a couple of changes if this should be accepted though: doc needs \versionadded{2.5}, I would prefer flags as the var name rather than i in posixmodule.c (btw you shouldn't need to init path). Also would need to update Misc/NEWS and ACKS if accepted. ---------------------------------------------------------------------- Comment By: Georg Brandl (gbrandl) Date: 2006-05-17 16:24 Message: Logged In: YES user_id=849994 Patch looks good. Do we want to include it? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1490190&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches