Menu

Absolute path names in Windows tar?

Help
Jeremy
2007-06-15
2012-07-26
  • Jeremy

    Jeremy - 2007-06-15

    Is there any way to specify the archive file with the "-f" option as an absolute path? For example "tar -cvf d:/test.tar files..." will not work, I have to use "tar -cvf /test.tar files..." but then the file ends up in the wrong drive. This will be called out of a script and I am not always going to be saving the file on the same drive. The reverse is not true, you can call "tar -cvf /test.tar e:\file e:\file ...." and it will work and archive the files. Thanks! - Jeremy

     
    • Adam

      Adam - 2007-09-12

      The only way I have found, to make this happen is with the -C argument.

      change your current path to your D:/ then use

      tar -cvf test.tar -C //./X:/Source/Folder ./

      And works the same way when extracting, change your path to the drive the archive is on and then use the same command syntex.

       
MongoDB Logo MongoDB