[LTP] [PATCH] tmpdir: rename tst_tmpdir_mkpath to tst_tmpdir_genpath
Li Wang
liwang@redhat.com
Wed Sep 11 08:02:07 CEST 2024
On Tue, Sep 10, 2024 at 4:53 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
> > When I reviewed the rename15 patch I felt confused a while on
> > function like tst_tmpdir_mkpath (reminds me of: mkdir).
> >
> > Because the name could be misleading since it suggests that a
> > file or directory is being created, when in fact it is simply
> > constructing a path inside a temporary directory without
> > actually creating any files.
>
> Good catch, this is indeed confusing.
>
> > To make the function's purpose clearer, the name should reflect
> > that it is only constructing or generating a path, not creating
> > any files or directories.
> >
> > So I think either 'tst_tmpdir_genpath' or 'tst_tmpdir_buildpath'
> > would be concise and clear options.
>
> Maybe tst_tmpdir_getpath()?
>
Hmm, I feel 'gen' is better than 'get', because get looks like there already
exist and we just get the path in a pointer. 'gen' is more like generating
a string but not creating it.
Maybe others have different opinions.
--
Regards,
Li Wang
More information about the ltp
mailing list