Menu

#11 "mkdir" problem under win32

open
None
2
2001-09-28
2001-08-31
No

under win32, mkdir can only create one subdir after another. so the author of old phpix (who only used internal gd - so maybe you lost notice of this bug, scince directorys were already present)
used this function to create the full direc- path in cache-directory:

function checkdir($pathname)
{
$darray = split("/",$pathname);
for ($x = 1; $x < sizeof($darray); $x++)
{
$chckdir = $darray[0];
for($y = 1; $y <= $x; $y++)
{
$chckdir = $chckdir . "/" . $darray[$y];
}
if (!file_exists($chckdir))
{
mkdir($chckdir,0755);
}
}
}

in function createimage(...)
the new internal gd -section looks now like:

if ($ImageTool == "int") {
$im = ImageCreateFromJPEG($source);
$new_im = ImageCreate($new_width,$new_height);

ImageCopyResized($new_im,$im,0,0,0,0,$new_width,$new_height,ImageSX($im),ImageSY($im));

$dirstr=$cache_base. "/" .$album;
checkdir( $dirstr);

ImageJPEG($new_im,$dest,75);
} elseif ($ImageTool == "ext") {

Discussion

  • Rémi Zara

    Rémi Zara - 2001-09-04

    Logged In: YES
    user_id=225508

    I would be willing to incorporate such a patch (for mkdir), but can you expose a case when directories are not created one at a time (by browsing the album hierarchy) ?
    Does the current implementation work on win32 ?

     
  • Rémi Zara

    Rémi Zara - 2001-09-22
    • priority: 5 --> 2
    • assigned_to: nobody --> rzara
    • summary: "mkdir" problem under win32 --> "mkdir" problem under win32
     
  • Andre Krause

    Andre Krause - 2001-09-28

    Logged In: YES
    user_id=242054

    hmm, i had this problem, but you are right - normally the
    subdirs should be created step by step.

    i have my own server (win nt with php and perl)

    -- if you are interested, i would create an ftp - account
    for you so that you could test phpix under win32 !!!
    please mail me - andre.krause@web.de

    phpix is working quite fine under winnt-servers - check my
    album under http://www.videofiles.de/album/index.php

    greetz, herc!

     
  • Andre Krause

    Andre Krause - 2001-09-28
    • summary: "mkdir" problem under win32 --> "mkdir" problem under win32
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.