]> granicus.if.org Git - php/commitdiff
add fstat to 027 test. Remove phar_dir_stat, stat should not be possible on a dir...
authorGreg Beaver <cellog@php.net>
Sun, 13 Apr 2008 23:57:44 +0000 (23:57 +0000)
committerGreg Beaver <cellog@php.net>
Sun, 13 Apr 2008 23:57:44 +0000 (23:57 +0000)
ext/phar/dirstream.c
ext/phar/tests/027.phpt

index 2f68badfbd96afa3f9b6416fd46d0e3c290a86f4..aaca07a7cd2f27a7a3d83cd7652f5ac5fda42590 100644 (file)
@@ -34,7 +34,7 @@ php_stream_ops phar_dir_ops = {
        "phar dir",
        phar_dir_seek,  /* seek */
        NULL,           /* cast */
-       phar_dir_stat,  /* stat */
+       NULL,           /* stat */
        NULL, /* set option */
 };
 
@@ -135,23 +135,6 @@ static int phar_dir_flush(php_stream *stream TSRMLS_DC) /* {{{ */
 }
 /* }}} */
 
-/**
- * Stat a dir in a phar
- */
-static int phar_dir_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */
-{
-       phar_entry_data *data = (phar_entry_data *)stream->abstract;
-
-       /* If ssb is NULL then someone is misbehaving */
-       if (!ssb) {
-               return -1;
-       }
-
-       phar_dostat(data->phar, data->internal_file, ssb, 0, data->phar->alias, data->phar->alias_len TSRMLS_CC);
-       return 0;
-}
-/* }}} */
-
 /**
  * add an empty element with a char * key to a hash table, avoiding duplicates
  *
index f3ebdb8c959b4b606f09529f262413e3162cd268..ca279ac87c291c687b259332d3e56b904f7097f2 100755 (executable)
@@ -48,6 +48,7 @@ var_dump(fseek($a, -1), ftell($a));
 var_dump(fseek($a, 1), ftell($a));
 echo "fwrite on dir handle\n";
 var_dump(fwrite($a, 'hi'));
+var_dump(fstat($a));
 closedir($a);
 ?>
 ===DONE===
@@ -77,4 +78,5 @@ int(0)
 int(1)
 fwrite on dir handle
 int(0)
+bool(false)
 ===DONE===