On Thu, 09 Mar 2006 17:19:15 +1300,
Greg Ewing [EMAIL PROTECTED] wrote:
I don't think that deleting the .DS_Store files is the
right approach to this, for various reasons:
[ ... ]
* It might not even work, since the .DS_Store could
get re-created in between your purge and creating
the
Dan Sommers wrote:
If these are both true, then *new* .DS_Store files could
be created after I've made the list and before I've made
the tarball.
not python related, but in order to creater the tarball without the .DS_Store
files why don't you use the --exclude=PATTERN option from tar ??
David Pratt wrote:
Hi Ben. I hadn't realize that walk was just giving the file name so the
join did the job just great.
I don't think that deleting the .DS_Store files is the
right approach to this, for various reasons:
* You're messing with MacOSX's metadata, which is
not a nice thing to
Hi Ben. I hadn't realize that walk was just giving the file name so the
join did the job just great. Many thanks for helping me out with this.
Regards,
David
Ben Cartwright wrote:
David Pratt wrote:
OSError: [Errno 2] No such file or directory: '.DS_Store'
Ah. You didn't mention a
Hi. I'm trying to clean files for packaging on mac using os.path.walk
and want to clean the .DS_Store files that are hidden from view but
could end up in code that I produce.
# Clean mac .DS_Store
if current_file == '.DS_Store':
print 'a DS_Store item encountered'
David Pratt wrote:
# Clean mac .DS_Store
if current_file == '.DS_Store':
print 'a DS_Store item encountered'
os.remove(f)
...
I can't figure why
remove is not removing.
It looks like your indentation is off. From what you posted, the
print line is prepended with 9
Hi Ben. Sorry about the cut and paste job into my email. It is part of a
larger script. It is actually all tabbed. This will give you a better idea:
for f in file_names:
current_file = os.path.basename(f)
print 'Current File: %s' %
David Pratt wrote:
Hi Ben. Sorry about the cut and paste job into my email. It is part of a
larger script. It is actually all tabbed. This will give you a better idea:
for f in file_names:
current_file = os.path.basename(f)
print
My apologies Ben. I should have included the traceback in my message.
The last line of the traceback I get from python when it gets to
os.remove is
OSError: [Errno 2] No such file or directory: '.DS_Store'
The traceback occurs immediately after printing:
Current File: .DS_Store
a DS_Store
David Pratt wrote:
OSError: [Errno 2] No such file or directory: '.DS_Store'
Ah. You didn't mention a traceback earlier, so I assumed the code was
executing but you didn't see the file being removed.
for f in file_names:
current_file = os.path.basename(f)
10 matches
Mail list logo