Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #3740
| Date | 2011-04-20 19:00 +0000 |
|---|---|
| From | <jyoung79@kc.rr.com> |
| Subject | RE: renaming files in OS X |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.666.1303326059.9059.python-list@python.org> (permalink) |
>> I'm considering using os.rename or shutil for renaming >> files on OS X (Snow Leopard)... > Hi Jay, > I don't know if os.rename() does what you want, but why > don't you try a simple test and find out? Surely an > empirical test is at least as useful as an answer from > someone like me who may or may not know what he's > talking about. =) > The OS X command xattr shows whether or not a file has > extended attributes, which are what I think you're > referring to when you say "metadata". xattr is written > (badly) in Python; on my system it lives in > /usr/bin/xattr-2.6 > You might also find this helpful: > http://jonsview.com/mac-os-x-resource-forks Hi Philip, Thank you very much for your reply. This actually does help a lot! I had done a bit of testing earlier, but I admit I'm quite ignorant on Apples file structure. Your excellent link had some great info and I did a few tests with what it had to say before and after I ran os.rename on a file. I also ran some applescript code to get the file/creator type before and after os.name (although I don't believe these types are actually part of the resource fork, they're still used by some scripts we run). So far, after running os.name, the file still contains everything I can think of so far. Again, thank you for your help with this! Jay
Back to comp.lang.python | Previous | Next | Find similar
RE: renaming files in OS X <jyoung79@kc.rr.com> - 2011-04-20 19:00 +0000
csiph-web