[LTP] [PATCH] tmpdir: rename tst_tmpdir_mkpath to tst_tmpdir_genpath

Jan Stancek jstancek@redhat.com
Wed Sep 11 08:23:33 CEST 2024


On Wed, Sep 11, 2024 at 8:02 AM Li Wang <liwang@redhat.com> wrote:
>
>
>
> 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.

tst_tmpdir_pathfmt
tst_tmpdir_mkpathname - seems too long

given the choices above, genpath seems OK to me as well

>
>
> --
> Regards,
> Li Wang



More information about the ltp mailing list