#21848 [Opn]: error with class and file system

From: Date: Fri, 24 Jan 2003 02:24:00 +0000
Subject: #21848 [Opn]: error with class and file system
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-31107@lists.php.net to get a copy of this message
ID: 21848 User updated by: epplestun@alaplaya.com Reported By: epplestun@alaplaya.com Status: Open Bug Type: *Directory/Filesystem functions Operating System: Linux Red Hat 8.0 PHP Version: 4.2.0 New Comment: excuse me i found the error :) if(!is_dir("modulos/".$directorio)) Previous Comments: ------------------------------------------------------------------------ [2003-01-23 18:40:27] epplestun@alaplaya.com Excuse me, me english is very poor but I want to contribute to PHP, I think this is not a programing problem. If the probem is so basic can you tell me what is the problem if you are a PHP guru?¿ And me intention was to warn of the possible error. ------------------------------------------------------------------------ [2003-01-23 17:10:04] gregory@myphpbugs.com please learn english guy,... and your problem is so basic... please, learn english but begin with learning php!! ------------------------------------------------------------------------ [2003-01-23 17:06:49] eppelestun@alamierda.com You are very ridiculus ------------------------------------------------------------------------ [2003-01-23 16:32:47] epplestun@alaplaya.com excuse me but the version of PHP is php-4.1.2 and with php-4.3.0 to. ------------------------------------------------------------------------ [2003-01-23 16:30:22] epplestun@alaplaya.com the script: class php_eddi_dev { var $gui; var $modulos; //cargador de las interfaces de los módulos. var $interface; //cargador de interfaz principal. // {{{ delete_event() /** * Constructor de la clase, genera el array gui global, la variable global interface que contendra la interface XML y carga la liberia PHP-GTK. * * @return void */ function php_eddi_dev() { dl(stristr(PHP_OS, "WIN") ? "php_gtk.dll" : "php_gtk.so"); $this->gui = array(); $this->modulos = array(); $this->interface = &new GladeXML("php-eddi-dev.glade"); } // }}} // {{{ salir() /** * Se encarga de cerrar la aplicacion GTK. * * @return void */ function salir() { Gtk::main_quit(); } // }}} // {{{ cargador_de_modulos() /** * Se encarga de cargar los modulos adicionales del PHP-EDDI-DEV. * * @return void TODO */ function cargador_de_modulos() { $handle = opendir("modulos/"); while ($directorio = readdir($handle)) { if ($directorio != "." AND $directorio != "..") { if(!is_dir($directorio)) { echo filetype($directorio) . "\n"; } } } } // }}} // {{{ main() /** * Se encarga de configurar y de lanzar la aplicación. * * @return void */ function main() { $this->gui['Gtk_Window'] = $this->interface->get_widget('ide'); $this->gui['Gtk_Window']->connect('destroy',array(&$this,'salir')); $this->gui['Gtk_Window']->set_usize(600,400); /** * Asignamos a la variable global color un color. */ $this->gui['color'] = new GdkColor('#898989'); /** * Creamos un estilo nuevo que se le aplicara a $this->gui['Gtk_Fixed']. */ $this->gui['estilo'] = new GtkStyle(); $this->gui['estilo']->bg[GTK_STATE_NORMAL] = $this->gui['color']; /** * Recogemos el widget de glade y le aplicamos el estilo. */ $this->gui['Gtk_Fixed'] = $this->interface->get_widget('entorno_desarrollo'); $this->gui['Gtk_Fixed']->set_style($this->gui['estilo']); gtk::main(); } // }}} } $programa = &new php_eddi_dev; //$programa->main(); $programa->cargador_de_modulos(); -------------------------------------------------------------- Running PHP 4.1.2 Zend Engine v1.1.1, Copyright (c) 1998-2001 Zend Technologies [PHP Modules] xml wddx standard sockets session posix pcre mysql ftp dbx [Zend Modules] Not Implemented The problem is: When I call to the function cargador_de_modulos() supposedly to show to me the directories of path that goes to the function opendir() to him but gives a warning me. <b>Warning</b>: lstat failed for prueba (errno=2 - No existe el fichero o el directorio) in <b>/root/php-eddi-dev/tests/php-eddi-dev/php-eddi-dev.php</b> on line <b>80</b><br>/root/php-eddi-dev/tests/php-eddi-dev/php-eddi-dev.php(80) : Warning - lstat failed for prueba (errno=2 - No existe el fichero o el directorio) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21848&edit=1

« previous php.bugs (#31107) next »