@Ptirhiik_:
I guess you're referring to is_file/is_link/is_dir.
First of all you won't be creating that many directories, so three checks won't make a visible difference. Can you limit that to one check though? Tell me how!
Errors in 0.0.11
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Re: Errors in 0.0.11
You are only looking for a directory or an not existing item, that's all
. If you want to translate this in optimized coding, you will write something like that :

Code: Select all
$exists = file_exists($foo);
if ( $exists && !is_dir($foo) )
{
// failed
}
else if ( !$exists )
{
// create
}
Re: Errors in 0.0.11
What you show does exactly the same, but uses one less call and one more variable. How much difference does it make considering that the script will only be used a few times (how many directories will you create for each mod?)
Besides, if you want an even more optimized code you would use:
Just one call and a variable used 8)
Anyway, Nuttzy will code it the way he likes it. I'm just glad I managed to make you all understand. Happy coding guyz
Besides, if you want an even more optimized code you would use:
Code: Select all
$type = @filetype($foo);
if ( empty($type) )
{
// create
}
elseif ( $type != 'dir' )
{
// failed
}
Anyway, Nuttzy will code it the way he likes it. I'm just glad I managed to make you all understand. Happy coding guyz

Re: Errors in 0.0.11
You seems to lack some knowledge about file access issue on different configurations
: believe me, I didn't this precise command hazardously, nor their. I didn't neither set a var to use with the file_exist() because it looks good
. Really, the code I granted is way better, as it will works on all configurations
. But well, that's not the point, is it ? 




Re: Errors in 0.0.11
I'm afraid you're true in what you say; I do lack technical knowledge and I've got no problem to admit it.Ptirhiik_ wrote:You seems to lack some knowledge about file access issue on different configurations: believe me, I didn't this precise command hazardously, nor their. I didn't neither set a var to use with the file_exist() because it looks good
. Really, the code I granted is way better, as it will works on all configurations
. But well, that's not the point, is it ?

Please tell me though, why doesn't filetype() work on all configurations? And where might I get some more info on possible issues between different filesystems/configurations?
Re: Errors in 0.0.11
Refer to the various php support board, and to the basic documentation. At least, performing numerous tests by yourself and having support to do on large-published script are the best to learn the traps.
Re: Errors in 0.0.11
Well, I've been searching about access issues lately, because I'm working on the ftp subsystem and have met with such problems. However, either I'm not looking at the right place or there have been no reports about filetype()
I guess I'll take your word for it and keep looking.
