Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Erwan Velu <erwan@enovance.com>
To: fio@vger.kernel.org
Subject: Surprising use of basename in finish_log_named
Date: Tue, 01 Apr 2014 17:00:20 +0200	[thread overview]
Message-ID: <533AD484.2040608@enovance.com> (raw)

Hi Jens,

I had a input of the fio irc channel (yes some at getting into it 
sometimes :p), and he had a very interesting point.

If you specify a full path name for the iops_log, the file will stay 
into the current dir.
While looking at the code I found that finish_log_named() is performing 
the following:

     char file_name[256], *p;
     snprintf(file_name, sizeof(file_name), "%s_%s.log", prefix, postfix);
     p = basename(file_name);

Why do we basename the file_name ? What's the reason of shrinking the 
path this way ?

Note for the author: 256 is maybe too small for some ? :)))

Cheers,
Erwan

             reply	other threads:[~2014-04-01 15:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 15:00 Erwan Velu [this message]
2014-04-01 18:49 ` Surprising use of basename in finish_log_named Jens Axboe
2014-04-02  8:11   ` Erwan Velu
2014-04-02 13:44     ` Jens Axboe

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=533AD484.2040608@enovance.com \
    --to=erwan@enovance.com \
    --cc=fio@vger.kernel.org \
    /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