tar: unable to specify archive name with -p option

Hi,

When I use -p option(preserve permissions) while creating tar archives, it throws error and creates archive in the name of 'p'. But without -p option I am able to create archive name as I mentioned.

how do I work it out with --preserve-permissions?

Any help is much appreciated.

Here is the result..

> ls
test
>
> tar -cfp test.tar test
tar: test.tar: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
>ls
p test
> tar -cf test.tar test
>ls
p test test.tar
>

Forget the hyphen

tar cfp test.tar test

Everything between the 'f' switch and the next option seperator (usually ' ') is considered to be the filename. So instead of

tar -cfp test.tar test

write

tar -cpf test.tar test

cool guys, both worked. Much appreciated.