Homec4science

Provide Filesystem::getUniqueFilename()

Authored by epriestley <git@epriestley.com> on Jul 29 2011, 21:34.

Description

Provide Filesystem::getUniqueFilename()

Summary: We do this in at least two places (D742 is one, and there's at least
one in Arcanist); provide a method for it since the logic is messy.
Test Plan:

php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,

'.'); echo $f;

/INSECURE/devtools/libphutil/derp
php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,

'.'); echo $f;

/INSECURE/devtools/libphutil/derp.1
php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,

'.'); echo $f;

/INSECURE/devtools/libphutil/derp.2
php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,

'.'); echo $f;

/INSECURE/devtools/libphutil/derp.3
php> $f = Filesystem::getUniqueFilename('derp'); Filesystem::writeFile($f,

'.'); echo $f;

/INSECURE/devtools/libphutil/derp.4

Reviewed By: aran
Reviewers: codeblock, jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 743

Details

Committed
epriestley <git@epriestley.com>Jul 29 2011, 22:05
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU720016c31d5d: Don't issue a "disk full" error if we couldn't determine disk free space
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU74b99cc33349: Provide Filesystem::getUniqueFilename() (authored by epriestley <git@epriestley.com>).Jul 29 2011, 22:05