Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggest PREFIX option [rt.cpan.org #49726] #12

Open
xdg opened this issue Apr 3, 2016 · 2 comments
Open

suggest PREFIX option [rt.cpan.org #49726] #12

xdg opened this issue Apr 3, 2016 · 2 comments
Labels

Comments

@xdg
Copy link
Contributor

xdg commented Apr 3, 2016

https://rt.cpan.org/Ticket/Display.html?id=49726

It'd be good if File::Temp had a PREFIX option like

    $fh = File::Temp->new (PREFIX => 'myprog');

which would generate a file "/tmp/myprogXXXXXX".

Emacs make-temp-file has this and it's a good way to work a program name
or module name into the filename, as a hint at who's to blame for
filling up /tmp. :-)

I got the effect I wanted with a TEMPLATE, but that then needs TMPDIR
turned on explicitly, and in any case I'd rather let File::Temp decide
how many "XXXXXX"s are prudent etc.

    $fh = File::Temp->new (TEMPLATE => 'myprog-XXXXXX',
                           TMPDIR => 1);

-- 
Advertising jargon elucidated for the layman:
"Gadget" - any product which by definition you'll buy then never use.
@xdg xdg added the wishlist label Apr 3, 2016
@nvevg
Copy link

nvevg commented Jun 28, 2018

Should PREFIX be ignored if DIR specified?

@knutov
Copy link

knutov commented Mar 22, 2019

Vote for this feature. Prefix for directories would be nice to have too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants