[PATCH] File::Path::mkpath, /dev, /dev/dir and /dev/000000 changes

While fetching GD with CPAN.PM, I ran into some problems with 
File::Path::mkpath, in particular with rooted logicals:

$ define/job/trans=conceal root_abcd_1  disk:[perl.cpan.build.id.blah.]

    mkpath('/root_abcd_1/lds')
fails with a "invalid parameter" error when it tries to 
mkdir('/root_abcd_1').  

There's a test in the code for a '000000' directory, but not for the
lack of a directory....I suspect that the test was put in to prevent
endless loops, prior to a modification of the File::Basename code.

So here's a change that does the following:

If you try to mkpath('/'), do nothing
If you try to mkpath('/dev'), convert to /dev/000000 (useful for rooted
     logicals where the main directory hasn't been created yet)
If you try to mkpath('/dev/foo'):
    -> /dev is the "parent", mkpath called recursively creates /dev/000000
    -> then create /dev/foo
If you try to mkpath('/dev/000000'):
    File::Basename::dirname gives '/dev/000000', so doesn't recurse
    creates /dev/000000

In all cases, it checks for a directories existance before attempting creation.

Passes all the (kinda wimpy) tests in t/lib/filepath.t, no more problem
with CPAN.pm.

Patch follows:
--- lib/file/path.pm-orig	Wed May 24 16:26:13 2000
+++ lib/file/path.pm	Thu May 25 09:25:34 2000
@@ -119,15 +119,18 @@
     my(@created,$path);
     foreach $path (@$paths) {
 	$path .= '/' if $^O eq 'os2' and $path =~ /^\w:\z/s; # feature of CRT 
-	next if -d $path;
 	# Logic wants Unix paths, so go with the flow.
-	$path = VMS::Filespec::unixify($path) if $Is_VMS;
-	my $parent = File::Basename::dirname($path);
-	# Allow for creation of new logical filesystems under VMS
-	if (not $Is_VMS or $parent !~ m:/[^/]+/000000/?:) {
-	    unless (-d $parent or $path eq $parent) {
-		push(@created,mkpath($parent, $verbose, $mode));
+	if ($Is_VMS) {
+	    next if $path eq '/';
+	    $path = VMS::Filespec::unixify($path);
+	    if ($path =~ m:^(/[^/]+)/?\z:) {
+	        $path = $1.'/000000';
 	    }
+	}
+	next if -d $path;
+	my $parent = File::Basename::dirname($path);
+	unless (-d $parent or $path eq $parent) {
+	    push(@created,mkpath($parent, $verbose, $mode));
 	}
 	print "mkdir $path\n" if $verbose;
 	unless (mkdir($path,$mode)) {
--
 Drexel University       \V                    --Chuck Lane
======]---------->--------*------------<-------[===========
     (215) 895-1545     _/ \  Particle Physics
FAX: (215) 895-5934     /\ /~~~~~~~~~~~        lane@duphy4.physics.drexel.edu
0
lane
5/25/2000 4:42:28 PM
perl.vmsperl 1645 articles. 0 followers. Follow

0 Replies
1030 Views

Similar Articles

[PageSpeed] 1

Reply:

Similar Artilces:

Merging dev-gaia and dev-b2g into dev-fxos
--001a113ce93ebce35d051e4c0c73 Content-Type: text/plain; charset=UTF-8 Hello people of Firefox OS, After a discussion we have decided that the distinction between dev-gaia and dev-b2g mailing lists is not enough to warrant maintaining two lists. So we are deprecating both in favor of dev-fxos. So if you are subscribed to one of the aforementioned lists, you will be subscribed to the new dev-fxos list and we will shortly be decommissioning dev-gaia and dev-b2g. Thanks! Michael --001a113ce93ebce35d051e4c0c73 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: qu...

Merging dev-gaia and dev-b2g into dev-fxos
--001a113ce93ebce35d051e4c0c73 Content-Type: text/plain; charset=UTF-8 Hello people of Firefox OS, After a discussion we have decided that the distinction between dev-gaia and dev-b2g mailing lists is not enough to warrant maintaining two lists. So we are deprecating both in favor of dev-fxos. So if you are subscribed to one of the aforementioned lists, you will be subscribed to the new dev-fxos list and we will shortly be decommissioning dev-gaia and dev-b2g. Thanks! Michael --001a113ce93ebce35d051e4c0c73 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: qu...

Missing device file /dev/sdb? and /dev/sdc?
Hello everybody, on my computer there are three identical harddisks. The fdisk -l output shows the following: Disk /dev/sda: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x000f41d3 Device Boot Start End Blocks Id System /dev/sda1 * 2 523 4192965 83 Linux /dev/sda2 524 38913 308367675 83 Linux Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 51...

*.dev = docs/dev/*.pod ??
Hi all, I've been reading through some of the pdd's and have noticed mention of *.dev files for actual implementation of features. I'm fairly sure these are actually the pod files under docs/dev, but I just wanted to make sure of this before I make the pdd's point to the files in this directory instead of the *.dev files. Thanks! Paul Paul Cochrane wrote: > Hi all, > > I've been reading through some of the pdd's and have noticed mention > of *.dev files for actual implementation of features. I'm fairly sure > these are actually ...

[PATCH] .dev files.
I'm happy to see new documentation, including the .dev files, appearing in parrot. However, I do have a small concern that we not set ourselves in a position of maintaining multiple copies of the same information. To be specific, I looked at byteorder.dev and noted a listing of all the functions. That's fine, but if the list of functions changes in the .c file, someone has to remember to go back and update the list in byteorder.dev as well. (I don't mean to pick on byteorder at all -- in fact quite the contrary -- because it's small, well-commented, and easy-to-foll...

DEv
Name: dany shemesh Email: dany74qatgmaildotcom Product: Shiretoko Alpha 2 Summary: DEv Comments: I`m a developer,looking for beta testing and development jobs. I love the community,my work is of course free. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2a1) Gecko/20090806 Namoroka/3.6a1 From URL: http://www.mozilla.org/projects/firefox/3.6a1/firstrun/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

dev
i have a dream it's... when i add something to my table of the database i want to show in the first page like.... i have a news table in database and when i add a news i need to show automaticlly this news in the news table of the main page... and i u can tell me how to it with the graphica that i made to be added to it i'll be so happy.. Hi, it sounds like you're just going to have a default page that has a repeater/datalist control of which you set the DataSource equal to a dataset filled with data from the news table. Please take a look at the quickstart tutorials for this. Please ...

Communication by Firefox devs to add-on devs
The time has come for the developers of Firefox to start communicating with the developers of add-ons. As a case in point: Recently the classic.manifest file in fx3 has had a large number of override codes added to it that reassigned filenames from example.png to example-aero.png. Suddenly, all third-party themes in Vista are now missing buttons in a number of places - some of them not easy to spot (e.g. - the wrap icon that shows up only when you reach the bottom of a page in a page search). If one of the themers had not had a user using Vista who communicated with him, and if the t...

/dev/hda vs /dev/hdb
Before I go and delete a bunch more files, this is right, right? Primary IDE channel: 2 HDDs Secondary IDE channel: 1 CD-DVD The HDD on the primary channel with the master jumper is /dev/hda The HDD on the primary channel jumpered to slave is /dev/hdb Gonna try this: dd if=/dev/hda of=/dev/hdb Wanting to clone HDD. Going the wrong direction would not be pretty. :) Greg wrote: > Before I go and delete a bunch more files, this is right, right? > > Primary IDE channel: 2 HDDs > > Secondary IDE channel: 1 CD-DVD > > The HDD on the primary channe...

Calendar:Dev Guide -- dev support
Hi calendar team! During todays telco you proposed to get more helpers for LG. Sounds good .... but maybe you can make life a bit easier? Calendar:Dev Guide gives a good overview about the code structure and pointing to a lot points. But how about a CVS link? And how to build a "Lightning.xpi" for testing any changes before going to post a change? I'm using eclispe with ANT (and XULbooster) which is doing very well for CVS as well as to build the XPI. Any help/links for that? G´┐Żnter Hello G=FCnter! The Dev_Guide is a bit out of date. Some things have c...

dev.b2g and dev.gaia redundancy?
I'm relatively new to the project but I see more overlap than not lately in the dev.b2g and dev.gaia newsgroups. Are the original motivations for having distinct groups still still applicable? Would things be easier for more people if we collapsed down to one group? Is that an awful idea? - A +1, half the emails are sent to both lists to take it further I am sitting alone in #fxos on irc On 4 December 2013 00:22, Asa Dotzler <asa@mozilla.com> wrote: > I'm relatively new to the project but I see more overlap than not lately > in the dev.b2g and dev....

mailman config changed; text/html should now show up in dev-gaia and dev-b2g and links should not be corrupted
This is a multi-part message in MIME format. --------------040907020305070007060305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Assuming all has gone well, the mailman list-server software we use for dev-b2g and dev-gaia should no longer force multipart/alternative mail messages to use the first sub-part (which is likely to be text/plain). What this means is that if you use the gmail web UI to talk on the list and your hyperlinks have ended up messed up, that should stop happening. (This, by definition, is/was a bug in gmail'...

mailman config changed; text/html should now show up in dev-gaia and dev-b2g and links should not be corrupted
This is a multi-part message in MIME format. --------------040907020305070007060305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Assuming all has gone well, the mailman list-server software we use for dev-b2g and dev-gaia should no longer force multipart/alternative mail messages to use the first sub-part (which is likely to be text/plain). What this means is that if you use the gmail web UI to talk on the list and your hyperlinks have ended up messed up, that should stop happening. (This, by definition, is/was a bug in gmail'...

Merging dev-tech-layout into dev-platform
Today I found out that I had missed a post from David Baron on dev-tech-layout, because I had no idea that this list exists. I think dev-platform is a better place to have the conversation related to the layout module (people are already having discussions about other modules over there). Does anybody have any objections? Cheers, Ehsan ...

Web resources about - [PATCH] File::Path::mkpath, /dev, /dev/dir and /dev/000000 changes - perl.vmsperl

Resources last updated: 1/15/2016 5:42:55 AM