Re: [Tutor] simply moving files]]

2009-05-13 Thread Kent Johnson
On Wed, May 13, 2009 at 3:58 AM, Alan Gauld wrote: > or for platform independance: > > os.sep.join([src,fnames]) or os.path.join(src, fnames) Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] simply moving files]]

2009-05-13 Thread David
Alan Gauld wrote: "David" wrote Forwarded to the list, I would also like to understand the forward slash; os.system("mv %s/%s %s" % (src, fnames, dst)) The slash separates the file path, src, from the filename. Thus if src is /foo/bar/baz and fnames is spam then %s/%s becomes /foo/bar/b

Re: [Tutor] simply moving files]]

2009-05-13 Thread Alan Gauld
"David" wrote Forwarded to the list, I would also like to understand the forward slash; os.system("mv %s/%s %s" % (src, fnames, dst)) The slash separates the file path, src, from the filename. Thus if src is /foo/bar/baz and fnames is spam then %s/%s becomes /foo/bar/baz/spam Another wa

Re: [Tutor] simply moving files

2009-05-12 Thread Alan Gauld
"Matt Herzog" wrote os.renames happily renames the source directory, but that's not what I want. Any other suggestions? You still haven't said why you can't use shutil.move() move() uses rename if appropriate or copies/deletes if not. It makes moving much more reliable and saves you a lot

Re: [Tutor] simply moving files

2009-05-12 Thread Kent Johnson
On Tue, May 12, 2009 at 1:51 PM, Matt Herzog wrote: > On monday I posted the below code: > > def schmove(src,dst): > ...         src = '/home/datasvcs/PIG/cjomeda_exp/' > ...         dst = '/home/datasvcs/PIG/cjomeda_exp_archive/' > ...         listOfFiles = os.listdir(src) > ...         for filez

Re: [Tutor] simply moving files]

2009-05-12 Thread David
David wrote: Subject: [Tutor] simply moving files From: Matt Herzog Date: Tue, 12 May 2009 13:51:36 -0400 To: Python List To: Python List On monday I posted the below code: def schmove(src,dst): ... src

[Tutor] simply moving files

2009-05-12 Thread Matt Herzog
On monday I posted the below code: def schmove(src,dst): ... src = '/home/datasvcs/PIG/cjomeda_exp/' ... dst = '/home/datasvcs/PIG/cjomeda_exp_archive/' ... listOfFiles = os.listdir(src) ... for filez in listOfFiles: ... os.system("mv"+ " " + src + " " +