delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/09/14:59:44

X-Spam-Check-By: sourceware.org
Message-ID: <00ee01c6a389$c34a20a0$1e8d11d8@moose>
From: "Brian Liedtke" <liedtke AT frii DOT com>
To: <cygwin AT cygwin DOT com>
References: <00e701c6a387$8ebb2660$1e8d11d8 AT moose> <20060709185040 DOT GA16824 AT trixie DOT casa DOT cgf DOT cx>
Subject: Re: Problem with embedded spaces in path name for --info-script switch in tar
Date: Sun, 9 Jul 2006 12:59:10 -0600
MIME-Version: 1.0
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

----- Original Message ----- 
From: "Christopher Faylor" <cgf-no-personal-reply-please AT cygwin DOT com>
To: <cygwin AT cygwin DOT com>
Sent: Sunday, July 09, 2006 12:50 PM
Subject: Re: Problem with embedded spaces in path name for --info-script 
switch in tar


> On Sun, Jul 09, 2006 at 12:43:23PM -0600, Brian Liedtke wrote:
>>Using tar-1.15.1-4.
>>
>>I am writing a script to create multi-volume archives using tar. However 
>>it
>>appears that the --info-script switch doesn't handle imbedded spaces in 
>>the
>>path name.
>>In the sample script below, I have hard-encoded the path to verify that 
>>was
>>the problem
>>and not with building the variable with the path name.
>>
>>Script:
>>#!/bin/bash
>>export ARCHIVE_DIR=/cygdrive/d
>>export ARCHIVE_NAME=full_`date +%y%m%d`
>>
>>tar -cv \
>>   --ignore-failed-read \
>>   --exclude=pagefile.sys \
>>   --exclude=*.vsv \
>>   -L4096 \
>>   -M --info-script="/cygdrive/c/Documents and Settings/Liedtke/My
>>Documents/Tasks/Backup/rename.sh" \
>>   -f$ARCHIVE_DIR/$ARCHIVE_NAME.tar .
>>
>># End script
>>
>>Output is:
>>tar: and: Warning: Cannot stat: No such file or directory.
>>tar: Settings/Liedtke/My: Warning: Cannot stat: No such file or directory.
>>tar: Documents/Tasks/Backup/rename.sh: Warning: Cannot stat: No such file
>>or directory
>>
>>I've devised a workaround by copying the script to the PWD previous to the
>>tar command and then
>>deleting it. But it should work as above, correct?
>>
>>I've searched for the problem on the web and found nothing. Am I missing
>>something
>>obvious, or is this switch not handling embedded spaces in the path name
>>correctly?
>>(Thank you Microsoft.)
----------------------------------------------------------------------------------
>
> "Microsoft" handles spaces in paths just fine.
>
> I don't know why tar isn't in this case but you can work around the 
> problem
> by mounting the directory as something else:
>
> mount -f -x -b c:/"Documents and Settings"/Liedtke/"My Documents" /foo
>
> And then refer to "/foo/Tasks/Backup/rename.sh".
>
> I haven't tested the above and may have a typo but hopefully it is obvious
> nonetheless.  If not, then possibly "man mount" would help.
>
> cgf
>
---------------------------------------------------------------------------------

Thanks for the suggestion.
It appears to be better that the kludge I came up with.
If no one comes up with something more on if this is a specific problem with
tar, I'll look into it myself when, and if, I get the time.

Brian 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019