Re: Spaces in filename



On 04/18/05 19:00, lvirden@xxxxxxxxx wrote:
According to Schelte Bron <nospam@xxxxxxxxxx>:
:On 04/18/05 12:35, lvirden@xxxxxxxxx wrote:
:> According to maxima2k <rh10023@xxxxxxxxxxx>:
:> :I am unable to figure out to create the double quotes I need. :> Try something like this:
:> :> $ tclsh
:> puts [format "zip -r \"%s\" \"%s\"" [file join intrepid samba $tname.zip] [file join c:
:"Documents and Settings" mydir "My Documents" *.*] ]
:> :I'm not on Windows but I think you should do something closer to this:
:puts [format {zip -r "\\%s\%s" "%s"} intrepid \
: [file nativename [file join samba hahmpc9bakup ­ryh-$tname.zip]] \
: [file nativename [file join "c:/Documents and Settings" mydir \
: "My Documents" *.*]]]



Hmm - why do you hard code the backslashes for intrepid? Is it something special? If so, then perhaps the window users know what special thing should be done to avoid hard coding those backslashes - the whole purpose of those special file minor commands was so that the developer never had to hard code slashes or backslashes, I thought.

Intrepid appears to be a machine name, not part of the path. I assume file join would join them togetether into a single backslash, giving something with a completely different meaning.


The file minor commands are only for local files, I think. Like I said, I'm not on Windows so I can't really check.

Schelte.
--
set Reply-To [string map {nospam schelte} $header(From)]
.



Relevant Pages

  • Re: 500 Cant connect to search.cpan.org:80 (Bad protocol tcp) at web.plline 24.
    ... >to have a literal backslash if Windows was looking at it. ... "genuine backslashes" may be required. ... the problem you have is with the dir command, ...
    (comp.lang.perl.misc)
  • Re: Thanks for help re: %userprofile%
    ... Python likes forward slashes in file names, whereas windows likes back ... The string does NOT actually contain any doubled backslashes. ...
    (comp.lang.python)
  • Re: Problem with os.chdir()
    ... In order to prevent this type of problems, I alway do the following: ... then supported normally by the Windows OS. ... Traceback: ... There need to be two backslashes at the beginning: ...
    (comp.lang.python)
  • Re: Loop through a text file line by line
    ... backslashes have special meaning in double-quoted strings. ... Windows obviously, so you have options. ... Here I want to loop through the file, ...
    (comp.lang.perl.misc)
  • Re: os.path.join doubt
    ... Just because Windows accepts / doesn't make it a good idea... ... No. Windows accepting slashes as the alternate path separator *enables* ... EOL while scanning string literal ... conflicts with Python's use of backslashes. ...
    (comp.lang.python)