Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Path-Class CPAN distribution.

Maintainer(s)' notes

I prefer that bugs & patches are filed on GitHub rather than on RT: https://github.com/kenahoo/Path-Class/issues. Thanks.

Report information
The Basics
Id: 83203
Status: open
Priority: 0/
Queue: Path-Class

People
Owner: Nobody in particular
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: parent incorrect with trailing updir
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 329
Download (untitled) / with headers
text/plain 329b
It looks like parent for dir() is just truncating a piece, which is incorrect if the last entry is "..". It should append another ".." instead, I believe. $ perl -MPath::Class -wE '$f=dir("/foo/bar/.."); $p = $f->parent; say $p' /foo/bar FWIW: This is perl 5, version 16, subversion 1 (v5.16.1) built for darwin-2level
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2629-1360279322-165.83203-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 246
Download (untitled) / with headers
text/plain 246b
That's an interesting question. I'm not so sure that's what it should do, arguably the parent of '/foo/bar/..' is indeed '/foo/bar', at least if one follows the Unix directory links. Are there practical issues suggesting one way or the other?
From david [...] autopragmatic.com Thu Feb 7 18: 39:47 2013
MIME-Version: 1.0
X-Spam-Status: No, score=-6.697 tagged_above=-99.9 required=10 tests=[AWL=0.203, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_HI=-5] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-2629-1360279323-999.83203-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
References: <RT-Ticket-83203 [...] rt.cpan.org> <rt-3.8.HEAD-2629-1360279323-999.83203-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.229.193.160 with SMTP id du32mr286947qcb.82.1360280377316; Thu, 07 Feb 2013 15:39:37 -0800 (PST)
Message-ID: <CAOeq1c_EtKN+UCixHfS-=P25n+oMUrqjESKyKAU6Unu-i_qu8w [...] mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.697
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] autopragmatic.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 41E8F2405BB for <cpan-bug+Path-Class [...] hipster.bestpractical.com>; Thu, 7 Feb 2013 18:39:47 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z9BNlKfLnDeV for <cpan-bug+Path-Class [...] hipster.bestpractical.com>; Thu, 7 Feb 2013 18:39:45 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 08FE02405BA for <bug-Path-Class [...] rt.cpan.org>; Thu, 7 Feb 2013 18:39:44 -0500 (EST)
Received: (qmail 5201 invoked by uid 103); 7 Feb 2013 23:39:43 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 7 Feb 2013 23:39:43 -0000
Received: from mail-qa0-f51.google.com (HELO mail-qa0-f51.google.com) (209.85.216.51) by 16.mx.develooper.com (qpsmtpd/0.84/v0.84-167-g4ed6cab) with ESMTP; Thu, 07 Feb 2013 15:39:40 -0800
Received: by mail-qa0-f51.google.com with SMTP id cr7so85869qab.17 for <bug-Path-Class [...] rt.cpan.org>; Thu, 07 Feb 2013 15:39:37 -0800 (PST)
Received: by 10.49.118.200 with HTTP; Thu, 7 Feb 2013 15:39:07 -0800 (PST)
Delivered-To: cpan-bug+Path-Class [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #83203] parent incorrect with trailing updir
Return-Path: <david [...] autopragmatic.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autopragmatic.com; s=google; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=MstN/LdK2PXZGavsjnwgDtt1KHgHqf6J9GiWIQX53iE=; b=djgKyT3Vmf2zwN8lqYmLvGz4FB/1qnDjSWZ91mLcNwLYHYn4RIExcVKt4HBYhETGIj 9j3vbnozh29wBeTOr1vFgZ2mjUb0NCIgK6ny1C1gVZ8Ew7aOT5w+6X7LoC7ViXUscj7I jKh8SwaM/dd/jhv32ePhuDWeDy/c9RcZ2tlTg=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Path-Class [...] hipster.bestpractical.com
X-RT-Mail-Extension: path-class
X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding:x-gm-message-state; bh=MstN/LdK2PXZGavsjnwgDtt1KHgHqf6J9GiWIQX53iE=; b=p3CQfCy1Wpf2IAgBsD/aPQbAfjtO+xs2tDoKzQSZlQD2W6icXGKh4GcfEH+xBkp6cH U2KsUnstcuyvpdRiBN+Z790i3CEMdi0w/Wvt+HUHvCncniOs5KR2BGtrrCr6cgx1YGJy ypw2GTi5w3U7xM2kBeI2CVXKxeZ+yeaJfAlG4N1SmvmbjgfI/N1KXq2q/e975HR6iayP L8PhW52v79WIi2v9gOlvxUOztbo0KP+DNqEZPRK5Iuadba5OoI6+bqdsphy99WTWRnth V+hWAhOrO5tPcHTFmluSIulU1LMTos+IxOSQc0rAXWwtQ7g67Sg6aAnfdDyoj14rIa7X 5Zlw==
X-Google-Sender-Auth: M-Vs8IlyPJDwdWl3XRCSPnMgbz8
Sender: david [...] autopragmatic.com
Date: Thu, 7 Feb 2013 18:39:07 -0500
X-Spam-Level:
To: bug-Path-Class [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: David Golden <dagolden [...] cpan.org>
X-GM-Message-State: ALoCoQmaNo+BgRkcyQYVn+e6yGYcL4ux6QrGx9tMudW8KRzWE5cKsS/jx8uliDhZGE8oBUAUH6CD
RT-Message-ID: <rt-3.8.HEAD-18727-1360280388-116.83203-0-0 [...] rt.cpan.org>
Content-Length: 861
Download (untitled) / with headers
text/plain 861b
On Thu, Feb 7, 2013 at 6:22 PM, Ken Williams via RT <bug-Path-Class@rt.cpan.org> wrote: Show quoted text
> That's an interesting question. I'm not so sure that's what it should do, > arguably the parent of '/foo/bar/..' is indeed '/foo/bar', at least if one > follows the Unix directory links.
/foo/bar/.. is /foo as long as symlinks aren't in the picture. E.g. assuming /tmp/bar exists, then "mkdir /tmp/bar/../baz" from the shell will create /tmp/baz. I think dir("/foo/bar/..")->parent should be "/foo/bar/../..". If someone wants to sort out the updirs, they can call resolve, after all. It's probably relevant for something like dir("/foo/bar/../baz") -- if someone calls parent twice, they should get "/foo/bar/../.." not "/foo/bar" as they do now. David -- David Golden <dagolden@cpan.org> Take back your inbox! → http://www.bunchmail.com/ Twitter/IRC: @xdg


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.