#267 Malfunctioning argument parsing in gnuwin32 TAR

Tar
open
nobody
None
5
2012-07-26
2005-06-20
Anonymous
No

Hi,

This seems like a bug - test case:

====================================
C:>tar -cvf
C:/tmp/0007-02-2005-06-17-01-00-34-archive.tar C:/tmp
tar: Cannot open
'C:/tmp/0007-02-2005-06-17-01-00-34-archive.tar':
Function not implemented
tar: Error is not recoverable: exiting now

C:>

Clearly, the above command should just work..

Quoting paths with either ' or " does not help.

Please advice.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    This happens because the archive is part of the directory to
    be archived; tar then has to start a forked process, which
    cannot be implemented on MS-Windows. As an alternative
    you can use Bsdtar, which also has the advantage that it can
    create tar.gz and tar.bz2 archives directly.

     
  • Nobody/Anonymous

    Logged In: NO

    Thanks for the reply!

    Doesn't seem to be the case however..

    Here's the test once again, this time putting the archive
    outside of the tmp area:

    C:> tar -cvf c:/0007-02-2005-06-17-01-00-34-archive.tar c:/tmp

    tar: Cannot open [snip]: Function not implemented
    tar: Error is not recoverable: exiting now

    As can be seen above, it still errors.
    Notice that the archive no longer resides in c:/tmp.

    I took a look at bsdtar and it is not a self-contained
    application as far as I could see, so it can't replace tar's
    role here :-/..

     
  • Nobody/Anonymous

    Logged In: NO

    Try the --force-local option

     
  • Nobody/Anonymous

    Logged In: NO

    Thanks a lot, using --force-local did the trick!

    Apologies for the noise.

    Please:
    * Mention that "--force-local" is needed on the GNUwin32
    TAR homepage.
    * Close this bug.