php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #491 Can't get rid of file system error message when file doesn't exist
Submitted: 1998-06-29 10:26 UTC Modified: 1998-06-29 13:27 UTC
From: khapeman at skidmore dot edu Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Final Release OS: Solaris 2.5.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: khapeman at skidmore dot edu
New email:
PHP Version: OS:

 

 [1998-06-29 10:26 UTC] khapeman at skidmore dot edu
<H1>File Error Message Test</H1>
<?
$cmd = "ls dir/transactions1/junk.170_*";
$tst = @exec($cmd);
?>

This produces the following message before the heading is displayed:

dir/transactions1/junk.170_*: No such file or directory 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-06-29 13:27 UTC] zeev
ls writes to stderr, which isn't piped by popen(), which
results in this behavior.  There's nothing you can do about
it at the PHP level.

You can, however, ask the shell to do the job for you,
by doing something like:

$tst = @exec("ls dir/transactions1/junk.170_* 2> /dev/null");

which tells sh to redirect all stderr output to /dev/null.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 23:01:31 2024 UTC