Jump to content

mkdir seems to create invisible directories....


Dragen

Recommended Posts

Hi,

I've got my script which checks if a directory exists, if not creates it. It seems to be working fine. I create the directory and upload a file to it and can then view the file on the server through my browser.

 

Now the problem starts when I look at it with any ftp client. For some reason I can't see the created directories or files. In my directory I should have something such as:

root/images/products/clothing/tops/myfile.gif

But I can only view up to products (which looks empty). Products is a directory created at the same time as the invisible directories/files, so it's confusing me... anyway, here's my code:

<?php
  if (is_dir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir)) {
    if (!is_writeable(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir)) $messageStack->add(ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
  } else {
  	mkdir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir, 0700);
  }
?>

 

am I using the mkdir wrong? I haven't used it before, but I don't see a problem with it.

 

Thanks

try this

 

<?php
  if (is_dir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir)) {
    if (!is_writeable(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir)) $messageStack->add(ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
  } else {
  	mkdir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . "$catdir", 0700);
  }
?>

thanks for the suggestions..

I'm not quite sure what putting the variable between quotes would do.

I testing creating a different directory and it works fine, it's just when I use the code above. My host say that the ownership settings may have been set up incorrectly. I have no idea what that means or how to change them, but they seemed to suggest that I couldn't, which makes me wonder how they could be set up incorrectly if I can't do anything to them :-\

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.