Perl-Toolchain-Gang / File-Fetch

8 stars 12 forks source link

fetch slurp writes to current working directory #6

Open keiranmraine opened 9 years ago

keiranmraine commented 9 years ago

Hi,

When using the slurp to scalar functionality although tempdir is used it creates the temp folder in the current working directory:

https://github.com/jib/file-fetch/blob/master/lib/File/Fetch.pm#L454

This may be just that the setting of tempdir_root is not documented, but if that value is not defined could an alternative path be used which uses the builtin capabilities of File::Temp to use the appropriate system defined 'tmp' instead (or emulate)?

$to = tempdir( 'FileFetch.XXXXXX', CLEANUP => 1, TMPDIR => 1 );

Regards, Keiran

GPHemsley commented 7 years ago

More permanent URL: https://github.com/Perl-Toolchain-Gang/File-Fetch/blob/345a53cc36eb2bb5f19d96b2dc897db5063c02d9/lib/File/Fetch.pm#L454