Re: Newbie Copy Question

From: Stacy (stacycollings_at_yahoo.com)
Date: 06/10/04


Date: 9 Jun 2004 17:01:29 -0700

Thanks for the response, Peter! Another reader helped me out, too,
but I figured out what the problem was...the folders and file names
are case-sensitive! Once I changed documents and settings...blah blah
blah to Documents and Settings blah blah blah it worked just fine.
I'm doing some computer migrations at work and I wanted to write a
frozen binary to copy all the important files automatically to my jump
drive for transfer to the new PC. BTW a jump drive is just a USB
thumb drive that I use to copy stuff from the old computers to the new
:)

Thanks again,

Stacy

Peter Hansen <peter@engcorp.com> wrote in message news:<fbednShX56BA01rdRVn-hg@powergate.ca>...
> Stacy wrote:
>
> > I'm new to Python (about 2 weeks) and I want to use the shutil module
> > to copy files from Windows XP folders to my jump drive. My problem is
> > that I can't figure out how to make Python deal with the spaces in
> > Windows folder and file names. I tried putting the path in quotes
> > (like you do at a DOS prompt) but still no good. I searched
> > python.org and can't find an answer....any ideas?
>
> Please post an example of the paths that aren't working. Spaces
> generally work fine, but perhaps the limitation is with your
> "jump drive" (what's that?) rather than with Python itself.
> Another possibility is that you are using single backslashes
> inside the Python strings, without realizing the effect this
> has when certain characters follow the backslash... this is
> because of the "escape sequences" allowed in strings to let
> a programmer produce special characters such as TAB (\t) or
> LF (\n). If that's the case, switching to forward slashes
> should work, or learn to use raw strings as in r'path\file'.
>
> -Peter



Relevant Pages

  • Re: Published forms
    ... Make sure that there is a replica of all relevant folders, and the Organizational Forms system folder if you use it, in the Exchange 2007 public store. ... Some users get - "the custom form could not be opened" - blah, ...
    (microsoft.public.exchange.admin)
  • Re: Cant redirect desktop folder -DO NOT RUN
    ... I want to redirect all my profile folders to a server. ... The way around this is to make your own junction points once you have ... xcopy....blah blah ...
    (microsoft.public.windows.vista.general)
  • Matching File Content Values within Multiple Folder
    ... Within each of those 300 folders is a text file. ... ID 30 Beer ... ID 31 Blah ... file that has the three values i'm looking for namely Pizza, ...
    (comp.lang.perl.misc)
  • Re: Walk folder - using cached folders
    ... takes Folders collection as a parameter. ... OutlookSpy - Outlook, CDO ... Set MAPIFolder = Folders.item ...
    (microsoft.public.outlook.program_forms)
  • Re: "??" file in home dir.
    ... > Probably came from a a malformed Shell redirect or whatever. ... the standard "No file or directory" blah blah blah... ... that might show you if there are special characters ... embedded in the filename. ...
    (Fedora)

Loading