[Discuss] confusing on name/usage of File.tempfile and Dir.tempdir

I need a feature, which create a new temp dir, as does tmpdir = Dir.mktmpdir("some_prefix") in Ruby, but it seem like this not feature available in Crystal.

Then, i notice that the name of following two api really confusing.

I suggest that we should give a clear name, e.g.

Old name New name Feature
File.tempfile File.mk_tempfile Create a temp file
not available Dir.mk_tempdir Create a temp dir
Dir.tempdir Dir.tempdir Get temp dir name

I like the proposed re-naming, but fear it would break things. So, it might take some care to implement.

1 Like