public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] tmpdir: rename tst_tmpdir_mkpath to tst_tmpdir_genpath
Date: Tue, 10 Sep 2024 10:52:29 +0200	[thread overview]
Message-ID: <ZuAIzfQCWY-6d2SR@yuki.lan> (raw)
In-Reply-To: <20240910071019.551379-1-liwang@redhat.com>

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()?

But I agree that any of these three is better than the original. Naming
API functions is hard...

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-09-10  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10  7:10 [LTP] [PATCH] tmpdir: rename tst_tmpdir_mkpath to tst_tmpdir_genpath Li Wang
2024-09-10  8:52 ` Cyril Hrubis [this message]
2024-09-11  6:02   ` Li Wang
2024-09-11  6:23     ` Jan Stancek
2024-09-11 15:00     ` Cyril Hrubis
2024-09-12  0:46       ` Li Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZuAIzfQCWY-6d2SR@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox