Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File::Path::mkpath on dosish system #828

Closed
p5pRT opened this issue Nov 9, 1999 · 2 comments
Closed

File::Path::mkpath on dosish system #828

p5pRT opened this issue Nov 9, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 9, 1999

Migrated from rt.perl.org#1756 (status was 'resolved')

Searchable as RT1756$

@p5pRT
Copy link
Author

p5pRT commented Nov 9, 1999

From horst_fickenscher@sepp.de

Created by horst_fickenscher@sepp.de

File​::Path​::mkpath("X​:\\foobar") will never return and eat up
memory if drive X​: is not known. It seems it calls itself endlessly.
Instead it should return with an error.

This is not a standard Perl Unix bug, but it's a standard
module, so I report the error in this way.

Horst

Perl Info


Site configuration information for perl 5.00502:

Summary of my perl5 (5.0 patchlevel 5 subversion 02) configuration:
  Platform:
    osname=MSWin32, osvers=4.0, archname=winnt4
    uname=''
    hint=recommended, useposix=true, d_sigaction=undef
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cl.exe', optimize='-Od -MD -DNDEBUG', gccversion=
    cppflags='-DWIN32'
    ccflags ='-Od -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT   '
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
    alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -release -machine:x86'
    libpth=e:\msdev\lib
    libs= oldnames.lib kernel32.lib user32.lib gdi32.lib  winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib  oleaut32.lib
netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl.lib
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
-machine:x86'

Locally applied patches:



@INC for perl 5.00502:
    C:/Programme/Plossys/Tools
    C:\Perl\lib/winnt4
    C:\Perl\lib
    C:\Perl\site\5.00502\lib
    C:\Perl\site\lib
    .


Environment for perl 5.00502:
    HOME (unset)
    LANG (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=C:\Bin;C:\Perl\Bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\nls\ENGLISH;C:\WINNT\system32\nls;\\seppfs1\horst\priv\bin;C:\programme\NTRESKIT;C:\programme\NTRESKIT\Perl;C:\Programme\Microsoft
Visual Studio\Common\Tools\WinNT;C:\Programme\Microsoft Visual
Studio\Common\MSDev98\Bin;C:\Programme\Microsoft Visual
Studio\Common\Tools;C:\Programme\Microsoft Visual Studio\VC98\bin
    PERLLIB=C:/Programme/Plossys/Tools
    PERL_BADLANG (unset)
    SHELL (unset)


--
Horst Fickenscher
S.E.P.P. AG & Co.              mailto:horst_fickenscher@sepp.de
Lohmuehlweg 4                   Phone: +49 (0) 9195/926-140
D-91341 Roettenbach             Fax:   +49 (0) 9195/1739
Germany                         WWW:   http://www.sepp.de

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 1999

From @gsar

On Tue, 09 Nov 1999 12​:01​:10 +0100, Horst Fickenscher wrote​:

File​::Path​::mkpath("X​:\\foobar") will never return and eat up
memory if drive X​: is not known. It seems it calls itself endlessly.
Instead it should return with an error.

Here's a fix.

Sarathy
gsar@​ActiveState.com

Inline Patch
-----------------------------------8<-----------------------------------
Change 4651 by gsar@onru on 1999/12/05 09:01:19

	on dosish platforms, avoid infinite recursion in File::Path::mkpath()
	when given non-existent drive names

Affected files ...

... //depot/perl/lib/File/Path.pm#16 edit

Differences ...

==== //depot/perl/lib/File/Path.pm#16 (text) ====
Index: perl/lib/File/Path.pm
--- perl/lib/File/Path.pm.~1~	Sun Dec  5 01:04:21 1999
+++ perl/lib/File/Path.pm	Sun Dec  5 01:04:21 1999
@@ -126,13 +126,15 @@
 	my $parent = File::Basename::dirname($path);
 	# Allow for creation of new logical filesystems under VMS
 	if (not $Is_VMS or $parent !~ m:/[^/]+/000000/?:) {
-	    push(@created,mkpath($parent, $verbose, $mode)) unless (-d $parent);
+	    unless (-d $parent or $path eq $parent) {
+		push(@created,mkpath($parent, $verbose, $mode));
+	    }
 	}
 	print "mkdir $path\n" if $verbose;
 	unless (mkdir($path,$mode)) {
-	  my $e = $!;
-	  # allow for another process to have created it meanwhile
-	  croak "mkdir $path: $e" unless -d $path;
+	    my $e = $!;
+	    # allow for another process to have created it meanwhile
+	    croak "mkdir $path: $e" unless -d $path;
 	}
 	push(@created, $path);
     }
End of Patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant