From unknown Sat Jun 14 05:06:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11271: dirname /home/dir/ Resent-From: Kevin Huanpeng Du Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 18 Apr 2012 16:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11271 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 11271@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.133476593028667 (code B ref -1); Wed, 18 Apr 2012 16:19:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Apr 2012 16:18:50 +0000 Received: from localhost ([127.0.0.1]:40065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKXai-0007SI-VF for submit@debbugs.gnu.org; Wed, 18 Apr 2012 12:18:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59719) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKSeC-00061p-Hb for submit@debbugs.gnu.org; Wed, 18 Apr 2012 07:02:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKSdp-0007h9-He for submit@debbugs.gnu.org; Wed, 18 Apr 2012 07:01:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKSdp-0007h2-Bn for submit@debbugs.gnu.org; Wed, 18 Apr 2012 07:01:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKSdn-0000TM-PT for bug-coreutils@gnu.org; Wed, 18 Apr 2012 07:01:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKSdh-0007g8-Ib for bug-coreutils@gnu.org; Wed, 18 Apr 2012 07:01:39 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:40734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKSdh-0007fd-8O for bug-coreutils@gnu.org; Wed, 18 Apr 2012 07:01:33 -0400 Received: by lbbgp10 with SMTP id gp10so3441027lbb.0 for ; Wed, 18 Apr 2012 04:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=hymawxQxA9a8CKH5U4wCDEzk24FyIX2nYm2xGpT2Tpc=; b=ITNTELZ37bPqjG/6NQY2+xA65G91HDlGsxMueBjfxBxwWPMKoQaDxaVNHt7K/iINdN IaZWF91/Qf+AkZrN8mFjL5Cn8mMMBTRxpkHJb2Z321O2XRoEIwkcGHjCfgPqsBWX4YWI Dq3d4rwuPhgDvaF5ZdIwkLiP8cD2SHv80aJTCLxy+DIWHDKJ+c3yRWHc9rKeqiHTQhOw r8MxiZwB0xoIvDCh8bwfRaWj2zW8qqrXxEnpcWSAluzmdFlR28QivY/f6YICtmkBnMhG gaQF5opBwV11tEzNtNkrnkQpWm6pTWmuD1pu5u6OX3LJQ8/8QVooVk9hrEvSTBlYnK2c JlGw== MIME-Version: 1.0 Received: by 10.112.28.1 with SMTP id x1mr774162lbg.82.1334746890152; Wed, 18 Apr 2012 04:01:30 -0700 (PDT) Received: by 10.112.38.130 with HTTP; Wed, 18 Apr 2012 04:01:29 -0700 (PDT) Received: by 10.112.38.130 with HTTP; Wed, 18 Apr 2012 04:01:29 -0700 (PDT) Date: Wed, 18 Apr 2012 19:01:29 +0800 Message-ID: From: Kevin Huanpeng Du Content-Type: multipart/alternative; boundary=bcaec554dcac40acc104bdf1fa9a X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Wed, 18 Apr 2012 12:18:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --bcaec554dcac40acc104bdf1fa9a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, i find dirname dirname strip a dir name when a string with out a filename. =E2=82=A4 dirname /dir/file =E2=82=A4 /dir =E2=82=A4 dirname /dir/subdir/ =E2=82=A4 /dir # is this right? subdir is a not a file. Thanks, Du Huangpeng --bcaec554dcac40acc104bdf1fa9a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi,
i find dirname dirname strip a dir name when a string with out a filename.<= /p>

=E2=82=A4 dirname /dir/file
=E2=82=A4 /dir
=E2=82=A4 dirname /dir/subdir/
=E2=82=A4 /dir # is this right? subdir is a not a file.

Thanks,
Du Huangpeng

--bcaec554dcac40acc104bdf1fa9a-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 18 13:35:56 2012 Received: (at control) by debbugs.gnu.org; 18 Apr 2012 17:35:56 +0000 Received: from localhost ([127.0.0.1]:40126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKYnI-0000tg-FJ for submit@debbugs.gnu.org; Wed, 18 Apr 2012 13:35:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1777) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKYn6-0000tJ-Ff; Wed, 18 Apr 2012 13:35:45 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3IHZOMU023772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Apr 2012 13:35:24 -0400 Received: from [10.3.113.83] (ovpn-113-83.phx2.redhat.com [10.3.113.83]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q3IHZO7A002652; Wed, 18 Apr 2012 13:35:24 -0400 Message-ID: <4F8EFB5B.1070308@redhat.com> Date: Wed, 18 Apr 2012 11:35:23 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Kevin Huanpeng Du Subject: Re: bug#11271: dirname /home/dir/ References: In-Reply-To: X-Enigmail-Version: 1.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigAC88C53DDFD3A4A9BD45B15E" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control Cc: 11271-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAC88C53DDFD3A4A9BD45B15E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 11271 notabug thanks On 04/18/2012 05:01 AM, Kevin Huanpeng Du wrote: > Hi, > i find dirname dirname strip a dir name when a string with out a filena= me. >=20 > =E2=82=A4 dirname /dir/file > =E2=82=A4 /dir > =E2=82=A4 dirname /dir/subdir/ > =E2=82=A4 /dir # is this right? subdir is a not a file. Thanks for the report. However, this is not a bug. POSIX requires this behavior. In POSIX parlance, a "file" is any entity that can be referenced by name as a member of a directory. There are multiple types of files: regular files, block device files, character device files, sockets, and important to your case, subdirectories. Only subdirectories may have a trailing slash, but the point remains that even without the trailing slash, 'subdir' is a file (of type directory, rather than the more typical type regular file), which can be referenced by name from the directory '/dir'. The POSIX-mandated algorithm for the dirname executable is to strip trailing slashes _before_ removing the trailing file name element, precisely for usage like this: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dirname.html 1 If string is //, skip steps 2 to 5. 2 If string consists entirely of characters, string shall be set to a single character. In this case, skip steps 3 to 8. 3 If there are any trailing characters in string, they shall be removed. 4 If there are no characters remaining in string, string shall be set to a single character. In this case, skip steps 5 to 8. 5 If there are any trailing non- characters in string, they shall be removed. 6 If the remaining string is //, it is implementation-defined whether steps 7 and 8 are skipped or processed. 7 If there are any trailing characters in string, they shall be removed. 8 If the remaining string is empty, string shall be set to a single character. And according to that algorithm, even though '/dir/subdir', '/dir/subdir/' and '/dir/subdir/.' all resolve to the same location in the file system, using dirname on the first two gives '/dir' while using 'dirname /dir/subdir/.' gives '/dir/subdir'. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigAC88C53DDFD3A4A9BD45B15E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPjvtbAAoJEKeha0olJ0Nq2YEH/2D0Czc+vwED+EPiwOHE4avy GGTdAzokgBjP+tg2Ipl9KICHJlsK9EARXx6O6FsYE1XYgaCAlDtSCgZXrcRvv5Fv kkP2Tyv8YC+Kx5LzhGI9C520btud48p0G0dKLJJFdrSti6zg5q3sFA+akvqDwDiA 3/r4ji3bv35P4ZEZVtgwzC1r+qVMlp2WTsQ5IX7BI59N8Mq0ymrKs0ooFa5J3bun /K5EXVaLF5hrBEQ//NvQ3pIgdvv4nCLiL1mi4bliBmriBX1+qHpkiV57nbpaQONh KXTw8Dx3kgDAINY7biFuuwvA5SdovdIhL2FHSw/WxNXU7CotWZEceYM2ZyOha6c= =qPXg -----END PGP SIGNATURE----- --------------enigAC88C53DDFD3A4A9BD45B15E-- From unknown Sat Jun 14 05:06:26 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Kevin Huanpeng Du Subject: bug#11271: closed (Re: bug#11271: dirname /home/dir/) Message-ID: References: <4F8EFB5B.1070308@redhat.com> X-Gnu-PR-Message: they-closed 11271 X-Gnu-PR-Package: coreutils X-Gnu-PR-Keywords: notabug Reply-To: 11271@debbugs.gnu.org Date: Wed, 18 Apr 2012 17:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1334770562-3482-1" This is a multi-part message in MIME format... ------------=_1334770562-3482-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #11271: dirname /home/dir/ which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 11271@debbugs.gnu.org. --=20 11271: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11271 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1334770562-3482-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 11271-done) by debbugs.gnu.org; 18 Apr 2012 17:35:52 +0000 Received: from localhost ([127.0.0.1]:40124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKYnC-0000tY-Tw for submit@debbugs.gnu.org; Wed, 18 Apr 2012 13:35:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1777) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKYn6-0000tJ-Ff; Wed, 18 Apr 2012 13:35:45 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3IHZOMU023772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Apr 2012 13:35:24 -0400 Received: from [10.3.113.83] (ovpn-113-83.phx2.redhat.com [10.3.113.83]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q3IHZO7A002652; Wed, 18 Apr 2012 13:35:24 -0400 Message-ID: <4F8EFB5B.1070308@redhat.com> Date: Wed, 18 Apr 2012 11:35:23 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Kevin Huanpeng Du Subject: Re: bug#11271: dirname /home/dir/ References: In-Reply-To: X-Enigmail-Version: 1.4 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigAC88C53DDFD3A4A9BD45B15E" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 11271-done Cc: 11271-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAC88C53DDFD3A4A9BD45B15E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 11271 notabug thanks On 04/18/2012 05:01 AM, Kevin Huanpeng Du wrote: > Hi, > i find dirname dirname strip a dir name when a string with out a filena= me. >=20 > =E2=82=A4 dirname /dir/file > =E2=82=A4 /dir > =E2=82=A4 dirname /dir/subdir/ > =E2=82=A4 /dir # is this right? subdir is a not a file. Thanks for the report. However, this is not a bug. POSIX requires this behavior. In POSIX parlance, a "file" is any entity that can be referenced by name as a member of a directory. There are multiple types of files: regular files, block device files, character device files, sockets, and important to your case, subdirectories. Only subdirectories may have a trailing slash, but the point remains that even without the trailing slash, 'subdir' is a file (of type directory, rather than the more typical type regular file), which can be referenced by name from the directory '/dir'. The POSIX-mandated algorithm for the dirname executable is to strip trailing slashes _before_ removing the trailing file name element, precisely for usage like this: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dirname.html 1 If string is //, skip steps 2 to 5. 2 If string consists entirely of characters, string shall be set to a single character. In this case, skip steps 3 to 8. 3 If there are any trailing characters in string, they shall be removed. 4 If there are no characters remaining in string, string shall be set to a single character. In this case, skip steps 5 to 8. 5 If there are any trailing non- characters in string, they shall be removed. 6 If the remaining string is //, it is implementation-defined whether steps 7 and 8 are skipped or processed. 7 If there are any trailing characters in string, they shall be removed. 8 If the remaining string is empty, string shall be set to a single character. And according to that algorithm, even though '/dir/subdir', '/dir/subdir/' and '/dir/subdir/.' all resolve to the same location in the file system, using dirname on the first two gives '/dir' while using 'dirname /dir/subdir/.' gives '/dir/subdir'. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigAC88C53DDFD3A4A9BD45B15E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPjvtbAAoJEKeha0olJ0Nq2YEH/2D0Czc+vwED+EPiwOHE4avy GGTdAzokgBjP+tg2Ipl9KICHJlsK9EARXx6O6FsYE1XYgaCAlDtSCgZXrcRvv5Fv kkP2Tyv8YC+Kx5LzhGI9C520btud48p0G0dKLJJFdrSti6zg5q3sFA+akvqDwDiA 3/r4ji3bv35P4ZEZVtgwzC1r+qVMlp2WTsQ5IX7BI59N8Mq0ymrKs0ooFa5J3bun /K5EXVaLF5hrBEQ//NvQ3pIgdvv4nCLiL1mi4bliBmriBX1+qHpkiV57nbpaQONh KXTw8Dx3kgDAINY7biFuuwvA5SdovdIhL2FHSw/WxNXU7CotWZEceYM2ZyOha6c= =qPXg -----END PGP SIGNATURE----- --------------enigAC88C53DDFD3A4A9BD45B15E-- ------------=_1334770562-3482-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Apr 2012 16:18:50 +0000 Received: from localhost ([127.0.0.1]:40065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKXai-0007SI-VF for submit@debbugs.gnu.org; Wed, 18 Apr 2012 12:18:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59719) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKSeC-00061p-Hb for submit@debbugs.gnu.org; Wed, 18 Apr 2012 07:02:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKSdp-0007h9-He for submit@debbugs.gnu.org; Wed, 18 Apr 2012 07:01:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKSdp-0007h2-Bn for submit@debbugs.gnu.org; Wed, 18 Apr 2012 07:01:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKSdn-0000TM-PT for bug-coreutils@gnu.org; Wed, 18 Apr 2012 07:01:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKSdh-0007g8-Ib for bug-coreutils@gnu.org; Wed, 18 Apr 2012 07:01:39 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:40734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKSdh-0007fd-8O for bug-coreutils@gnu.org; Wed, 18 Apr 2012 07:01:33 -0400 Received: by lbbgp10 with SMTP id gp10so3441027lbb.0 for ; Wed, 18 Apr 2012 04:01:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=hymawxQxA9a8CKH5U4wCDEzk24FyIX2nYm2xGpT2Tpc=; b=ITNTELZ37bPqjG/6NQY2+xA65G91HDlGsxMueBjfxBxwWPMKoQaDxaVNHt7K/iINdN IaZWF91/Qf+AkZrN8mFjL5Cn8mMMBTRxpkHJb2Z321O2XRoEIwkcGHjCfgPqsBWX4YWI Dq3d4rwuPhgDvaF5ZdIwkLiP8cD2SHv80aJTCLxy+DIWHDKJ+c3yRWHc9rKeqiHTQhOw r8MxiZwB0xoIvDCh8bwfRaWj2zW8qqrXxEnpcWSAluzmdFlR28QivY/f6YICtmkBnMhG gaQF5opBwV11tEzNtNkrnkQpWm6pTWmuD1pu5u6OX3LJQ8/8QVooVk9hrEvSTBlYnK2c JlGw== MIME-Version: 1.0 Received: by 10.112.28.1 with SMTP id x1mr774162lbg.82.1334746890152; Wed, 18 Apr 2012 04:01:30 -0700 (PDT) Received: by 10.112.38.130 with HTTP; Wed, 18 Apr 2012 04:01:29 -0700 (PDT) Received: by 10.112.38.130 with HTTP; Wed, 18 Apr 2012 04:01:29 -0700 (PDT) Date: Wed, 18 Apr 2012 19:01:29 +0800 Message-ID: Subject: dirname /home/dir/ From: Kevin Huanpeng Du To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=bcaec554dcac40acc104bdf1fa9a X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 18 Apr 2012 12:18:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --bcaec554dcac40acc104bdf1fa9a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, i find dirname dirname strip a dir name when a string with out a filename. =E2=82=A4 dirname /dir/file =E2=82=A4 /dir =E2=82=A4 dirname /dir/subdir/ =E2=82=A4 /dir # is this right? subdir is a not a file. Thanks, Du Huangpeng --bcaec554dcac40acc104bdf1fa9a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi,
i find dirname dirname strip a dir name when a string with out a filename.<= /p>

=E2=82=A4 dirname /dir/file
=E2=82=A4 /dir
=E2=82=A4 dirname /dir/subdir/
=E2=82=A4 /dir # is this right? subdir is a not a file.

Thanks,
Du Huangpeng

--bcaec554dcac40acc104bdf1fa9a-- ------------=_1334770562-3482-1--