Re: System errno in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Hmm.. I know I can check such sings as if file exists or has right
permission before fopen.
 But it does not mean that file will still exists with right permission a
moment later when
fopen will be issued.
 And I can't check everything. I can't image how to check whether file is
locked, or if it is on read only filesystems or
if limit of opened fil was  reached ...
 Similar problem can be with fseek, fread,...

By

On 20/02/2008, Stut <stuttle@xxxxxxxxx> wrote:
>
> Michal Maras wrote:
> > I have read http://php.net/fopen from top to bottom, but I could not
> find
> > how to get  system error number.
> > With set_error_handler I can get string for example
> >
> > fopen(hmc_configuration.cfg)
> > [function.fopen<
> http://ds63450.mspr.detemobil.de/%7Emmaras/HMC/function.fopen>]:
> > failed to open stream: Permission denied
> >
> > but I need integer number not string, because string error messages
> depends
> > on locale setting.
> >  Of course, I can test some conditions before fopen, but it is not
> enough
> > for me.
>
> What exactly are you trying to do? Why do you need the specific reason
> why it failed? It's pretty-much always a case of file not found or
> insufficient permissions, both of which you can check for before going
> near fopen.
>
> -Stut
>
> --
> http://stut.net/
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux