in reply to Re: symlinks in Archive::Tar?
in thread symlinks in Archive::Tar?

Apologies, I should of been clearer, I actually do exactally what you said already, I just shortend the paths to improve the look & feel on perl monks and forgot to shorten one of them in my original question.

All files are indeed under the path:

/webroot/service/servicelist/ss/

I am adding the symlink name and not the file to the archive already as...

tar->add_files("/webroot/service/servicelist/ss/rasprofile-fr-eng.pdf" +);

Sorry for the confusion, there is actually no file at...

/webroot/rasprofile-fr-eng.pdf

Replies are listed 'Best First'.
Re: Re: Re: symlinks in Archive::Tar?
by steves (Curate) on Feb 19, 2003 at 23:11 UTC

    Okay ... so where is the real file the symlink points to (what directory)? And do you get any errors at all? Looking at the code I see attempts to symlink if the file being extracted has a file mode setting indicating it's a symbolic link. There's a warning if that fails. Can you easily check the file mode settings and see if the file that ends up in the archive has the symlink bit set?

    Looking at the code, I can see they do (on UNIX) a -l check when the file is added; set a SYMLINK file type and save the file its linked to if that's set; then try to call symlink if they see the SYMLINK entry type during extraction using the saved values. The reason I think you'll have problems with relative path names is that I don't see any path information being stored with the link name ... not sure if that matters if it's relative since you'd want it relative on the way out? I'd need to see what directory they think they're in though ...

    If you have access to the source and can modify it I'd probably just copy it and put some debug in there. It may make it very clear with a smaller amount of effort than debugging around the module.