File-error code?

File-error code?

am 10.09.2007 12:01:00 von Gustav Wiberg

Hi!
=20
I test using readfile($filename) and that's ok. When I'm logged in with "in=
correct user" I get permission denied... Is there any way of retrieving the=
"permission denied" code? when using readfile? (or any other error regardi=
ng to readfile-function?
=20
Best regards
/Gustav Wiberg

No virus found in this outgoing message.
Checked by AVG Free Edition.=20
Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09=
10:17
=20

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File-error code?

am 10.09.2007 14:09:52 von John Mertic

You can use is_file() and is_readable() to determine if the file
exists and is readable. That's not really getting you any sort of
"error code", but it least it helps narrow things down.

John

On 9/10/07, Gustav Wiberg wrote:
> Hi!
>
> Yes, that's correct.
>
> Best regards
> /Gustav Wiberg
>
>
> -----Original Message-----
> From: John Mertic [mailto:jmertic@gmail.com]
> Sent: Monday, September 10, 2007 1:55 PM
> To: Gustav Wiberg
> Subject: Re: [PHP-WIN] File-error code?
>
> I guess my question is from where ( HTTP error code, etc ) and what
> choices are you looking for in terms of a sub code ( file not found,
> not readable, etc ).
>
> On 9/10/07, Gustav Wiberg wrote:
> > Permission denied
> >
> > Best regards
> > /Gustav Wiberg
> >
> >
> > -----Original Message-----
> > From: John Mertic [mailto:jmertic@gmail.com]
> > Sent: Monday, September 10, 2007 1:30 PM
> > To: Gustav Wiberg
> > Subject: Re: [PHP-WIN] File-error code?
> >
> > Hi,
> >
> > What code are you looking for?
> >
> > John
> >
> > On 9/10/07, Gustav Wiberg wrote:
> > > Hi!
> > >
> > > I test using readfile($filename) and that's ok. When I'm logged in with "incorrect user" I get permission denied... Is there any way of retrieving the "permission denied" code? when using readfile? (or any other error regarding to readfile-function?
> > >
> > > Best regards
> > > /Gustav Wiberg
> > >
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > --
> > --
> > John Mertic "Explaining a joke
> > is like dissecting a frog: you
> > jmertic@gmail.com understand it better,
> > but the frog dies in the
> > process."
> >
> > -Mark Twain
> >
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> >
> >
> >
> >
>
>
> --
> --
> John Mertic "Explaining a joke
> is like dissecting a frog: you
> jmertic@gmail.com understand it better,
> but the frog dies in the
> process."
>
> -Mark Twain
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
>
>
>
>


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: File-error code?

am 10.09.2007 16:11:00 von Gustav Wiberg

Hi!

Ok. That is the only option then?

Best regards
/Gustav Wiberg
=20

-----Original Message-----
From: John Mertic [mailto:jmertic@gmail.com]=20
Sent: Monday, September 10, 2007 2:10 PM
To: Gustav Wiberg; php windows
Subject: Re: [PHP-WIN] File-error code?

You can use is_file() and is_readable() to determine if the file
exists and is readable. That's not really getting you any sort of
"error code", but it least it helps narrow things down.

John

On 9/10/07, Gustav Wiberg wrote:
> Hi!
>
> Yes, that's correct.
>
> Best regards
> /Gustav Wiberg
>
>
> -----Original Message-----
> From: John Mertic [mailto:jmertic@gmail.com]
> Sent: Monday, September 10, 2007 1:55 PM
> To: Gustav Wiberg
> Subject: Re: [PHP-WIN] File-error code?
>
> I guess my question is from where ( HTTP error code, etc ) and what
> choices are you looking for in terms of a sub code ( file not found,
> not readable, etc ).
>
> On 9/10/07, Gustav Wiberg wrote:
> > Permission denied
> >
> > Best regards
> > /Gustav Wiberg
> >
> >
> > -----Original Message-----
> > From: John Mertic [mailto:jmertic@gmail.com]
> > Sent: Monday, September 10, 2007 1:30 PM
> > To: Gustav Wiberg
> > Subject: Re: [PHP-WIN] File-error code?
> >
> > Hi,
> >
> > What code are you looking for?
> >
> > John
> >
> > On 9/10/07, Gustav Wiberg wrote:
> > > Hi!
> > >
> > > I test using readfile($filename) and that's ok. When I'm logged in wi=
th "incorrect user" I get permission denied... Is there any way of retrievi=
ng the "permission denied" code? when using readfile? (or any other error r=
egarding to readfile-function?
> > >
> > > Best regards
> > > /Gustav Wiberg
> > >
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007=
-09-09 10:17
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > --
> > --
> > John Mertic "Explaining a joke
> > is like dissecting a frog: you
> > jmertic@gmail.com understand it better,
> > but the frog dies in the
> > process."
> >
> > -Mark Twain
> >
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-0=
9-09 10:17
> >
> >
> >
> >
>
>
> --
> --
> John Mertic "Explaining a joke
> is like dissecting a frog: you
> jmertic@gmail.com understand it better,
> but the frog dies in the
> process."
>
> -Mark Twain
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-=
09 10:17
>
>
>
>


--=20
--=20
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


No virus found in this outgoing message.
Checked by AVG Free Edition.=20
Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09=
10:17
=20

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File-error code?

am 10.09.2007 16:13:47 von John Mertic

For the most part yes. Please elaborate if there is something
particular you are looking for?

John

On 9/10/07, Gustav Wiberg wrote:
> Hi!
>
> Ok. That is the only option then?
>
> Best regards
> /Gustav Wiberg
>
>
> -----Original Message-----
> From: John Mertic [mailto:jmertic@gmail.com]
> Sent: Monday, September 10, 2007 2:10 PM
> To: Gustav Wiberg; php windows
> Subject: Re: [PHP-WIN] File-error code?
>
> You can use is_file() and is_readable() to determine if the file
> exists and is readable. That's not really getting you any sort of
> "error code", but it least it helps narrow things down.
>
> John
>
> On 9/10/07, Gustav Wiberg wrote:
> > Hi!
> >
> > Yes, that's correct.
> >
> > Best regards
> > /Gustav Wiberg
> >
> >
> > -----Original Message-----
> > From: John Mertic [mailto:jmertic@gmail.com]
> > Sent: Monday, September 10, 2007 1:55 PM
> > To: Gustav Wiberg
> > Subject: Re: [PHP-WIN] File-error code?
> >
> > I guess my question is from where ( HTTP error code, etc ) and what
> > choices are you looking for in terms of a sub code ( file not found,
> > not readable, etc ).
> >
> > On 9/10/07, Gustav Wiberg wrote:
> > > Permission denied
> > >
> > > Best regards
> > > /Gustav Wiberg
> > >
> > >
> > > -----Original Message-----
> > > From: John Mertic [mailto:jmertic@gmail.com]
> > > Sent: Monday, September 10, 2007 1:30 PM
> > > To: Gustav Wiberg
> > > Subject: Re: [PHP-WIN] File-error code?
> > >
> > > Hi,
> > >
> > > What code are you looking for?
> > >
> > > John
> > >
> > > On 9/10/07, Gustav Wiberg wrote:
> > > > Hi!
> > > >
> > > > I test using readfile($filename) and that's ok. When I'm logged in with "incorrect user" I get permission denied... Is there any way of retrieving the "permission denied" code? when using readfile? (or any other error regarding to readfile-function?
> > > >
> > > > Best regards
> > > > /Gustav Wiberg
> > > >
> > > > No virus found in this outgoing message.
> > > > Checked by AVG Free Edition.
> > > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> > > >
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > >
> > > --
> > > --
> > > John Mertic "Explaining a joke
> > > is like dissecting a frog: you
> > > jmertic@gmail.com understand it better,
> > > but the frog dies in the
> > > process."
> > >
> > > -Mark Twain
> > >
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> > >
> > >
> > >
> > >
> >
> >
> > --
> > --
> > John Mertic "Explaining a joke
> > is like dissecting a frog: you
> > jmertic@gmail.com understand it better,
> > but the frog dies in the
> > process."
> >
> > -Mark Twain
> >
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> >
> >
> >
> >
>
>
> --
> --
> John Mertic "Explaining a joke
> is like dissecting a frog: you
> jmertic@gmail.com understand it better,
> but the frog dies in the
> process."
>
> -Mark Twain
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
>
>
>
>


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: File-error code?

am 11.09.2007 08:35:00 von Gustav Wiberg

Hi!

I have solved the problem, but I just wondered if there were any options. I=
use @scandir, and when no error occurs then it shows folders from the spec=
ified folder in scandir-function. But this doesn't seem like "good" program=
ming practice... ;-)

Best regards
/Gustav Wiberg
=20

-----Original Message-----
From: John Mertic [mailto:jmertic@gmail.com]=20
Sent: Monday, September 10, 2007 4:14 PM
To: Gustav Wiberg
Cc: php windows
Subject: Re: [PHP-WIN] File-error code?

For the most part yes. Please elaborate if there is something
particular you are looking for?

John

On 9/10/07, Gustav Wiberg wrote:
> Hi!
>
> Ok. That is the only option then?
>
> Best regards
> /Gustav Wiberg
>
>
> -----Original Message-----
> From: John Mertic [mailto:jmertic@gmail.com]
> Sent: Monday, September 10, 2007 2:10 PM
> To: Gustav Wiberg; php windows
> Subject: Re: [PHP-WIN] File-error code?
>
> You can use is_file() and is_readable() to determine if the file
> exists and is readable. That's not really getting you any sort of
> "error code", but it least it helps narrow things down.
>
> John
>
> On 9/10/07, Gustav Wiberg wrote:
> > Hi!
> >
> > Yes, that's correct.
> >
> > Best regards
> > /Gustav Wiberg
> >
> >
> > -----Original Message-----
> > From: John Mertic [mailto:jmertic@gmail.com]
> > Sent: Monday, September 10, 2007 1:55 PM
> > To: Gustav Wiberg
> > Subject: Re: [PHP-WIN] File-error code?
> >
> > I guess my question is from where ( HTTP error code, etc ) and what
> > choices are you looking for in terms of a sub code ( file not found,
> > not readable, etc ).
> >
> > On 9/10/07, Gustav Wiberg wrote:
> > > Permission denied
> > >
> > > Best regards
> > > /Gustav Wiberg
> > >
> > >
> > > -----Original Message-----
> > > From: John Mertic [mailto:jmertic@gmail.com]
> > > Sent: Monday, September 10, 2007 1:30 PM
> > > To: Gustav Wiberg
> > > Subject: Re: [PHP-WIN] File-error code?
> > >
> > > Hi,
> > >
> > > What code are you looking for?
> > >
> > > John
> > >
> > > On 9/10/07, Gustav Wiberg wrote:
> > > > Hi!
> > > >
> > > > I test using readfile($filename) and that's ok. When I'm logged in =
with "incorrect user" I get permission denied... Is there any way of retrie=
ving the "permission denied" code? when using readfile? (or any other error=
regarding to readfile-function?
> > > >
> > > > Best regards
> > > > /Gustav Wiberg
> > > >
> > > > No virus found in this outgoing message.
> > > > Checked by AVG Free Edition.
> > > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 20=
07-09-09 10:17
> > > >
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > >
> > > --
> > > --
> > > John Mertic "Explaining a joke
> > > is like dissecting a frog: you
> > > jmertic@gmail.com understand it better,
> > > but the frog dies in the
> > > process."
> > >
> > > -Mark Twain
> > >
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007=
-09-09 10:17
> > >
> > >
> > >
> > >
> >
> >
> > --
> > --
> > John Mertic "Explaining a joke
> > is like dissecting a frog: you
> > jmertic@gmail.com understand it better,
> > but the frog dies in the
> > process."
> >
> > -Mark Twain
> >
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-0=
9-09 10:17
> >
> >
> >
> >
>
>
> --
> --
> John Mertic "Explaining a joke
> is like dissecting a frog: you
> jmertic@gmail.com understand it better,
> but the frog dies in the
> process."
>
> -Mark Twain
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-=
09 10:17
>
>
>
>


--=20
--=20
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


No virus found in this outgoing message.
Checked by AVG Free Edition.=20
Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09=
10:17
=20

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File-error code?

am 11.09.2007 13:44:12 von John Mertic

Yeah, that's kinda of heavyweight solution to the problem ( not to
mention is much slower than using opendir(), readdir(), and closedir()
since scandir() sorts the results as well ).

If you are just checking for access, either opendir() or is_readable()
should work much faster. But I guess I don't really understand the
context of your issue either, which may dictate why one way of doing
things might be better than another.

John

On 9/11/07, Gustav Wiberg wrote:
> Hi!
>
> I have solved the problem, but I just wondered if there were any options. I use @scandir, and when no error occurs then it shows folders from the specified folder in scandir-function. But this doesn't seem like "good" programming practice... ;-)
>
> Best regards
> /Gustav Wiberg
>
>
> -----Original Message-----
> From: John Mertic [mailto:jmertic@gmail.com]
> Sent: Monday, September 10, 2007 4:14 PM
> To: Gustav Wiberg
> Cc: php windows
> Subject: Re: [PHP-WIN] File-error code?
>
> For the most part yes. Please elaborate if there is something
> particular you are looking for?
>
> John
>
> On 9/10/07, Gustav Wiberg wrote:
> > Hi!
> >
> > Ok. That is the only option then?
> >
> > Best regards
> > /Gustav Wiberg
> >
> >
> > -----Original Message-----
> > From: John Mertic [mailto:jmertic@gmail.com]
> > Sent: Monday, September 10, 2007 2:10 PM
> > To: Gustav Wiberg; php windows
> > Subject: Re: [PHP-WIN] File-error code?
> >
> > You can use is_file() and is_readable() to determine if the file
> > exists and is readable. That's not really getting you any sort of
> > "error code", but it least it helps narrow things down.
> >
> > John
> >
> > On 9/10/07, Gustav Wiberg wrote:
> > > Hi!
> > >
> > > Yes, that's correct.
> > >
> > > Best regards
> > > /Gustav Wiberg
> > >
> > >
> > > -----Original Message-----
> > > From: John Mertic [mailto:jmertic@gmail.com]
> > > Sent: Monday, September 10, 2007 1:55 PM
> > > To: Gustav Wiberg
> > > Subject: Re: [PHP-WIN] File-error code?
> > >
> > > I guess my question is from where ( HTTP error code, etc ) and what
> > > choices are you looking for in terms of a sub code ( file not found,
> > > not readable, etc ).
> > >
> > > On 9/10/07, Gustav Wiberg wrote:
> > > > Permission denied
> > > >
> > > > Best regards
> > > > /Gustav Wiberg
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: John Mertic [mailto:jmertic@gmail.com]
> > > > Sent: Monday, September 10, 2007 1:30 PM
> > > > To: Gustav Wiberg
> > > > Subject: Re: [PHP-WIN] File-error code?
> > > >
> > > > Hi,
> > > >
> > > > What code are you looking for?
> > > >
> > > > John
> > > >
> > > > On 9/10/07, Gustav Wiberg wrote:
> > > > > Hi!
> > > > >
> > > > > I test using readfile($filename) and that's ok. When I'm logged in with "incorrect user" I get permission denied... Is there any way of retrieving the "permission denied" code? when using readfile? (or any other error regarding to readfile-function?
> > > > >
> > > > > Best regards
> > > > > /Gustav Wiberg
> > > > >
> > > > > No virus found in this outgoing message.
> > > > > Checked by AVG Free Edition.
> > > > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> > > > >
> > > > >
> > > > > --
> > > > > PHP Windows Mailing List (http://www.php.net/)
> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > --
> > > > John Mertic "Explaining a joke
> > > > is like dissecting a frog: you
> > > > jmertic@gmail.com understand it better,
> > > > but the frog dies in the
> > > > process."
> > > >
> > > > -Mark Twain
> > > >
> > > > No virus found in this outgoing message.
> > > > Checked by AVG Free Edition.
> > > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > --
> > > John Mertic "Explaining a joke
> > > is like dissecting a frog: you
> > > jmertic@gmail.com understand it better,
> > > but the frog dies in the
> > > process."
> > >
> > > -Mark Twain
> > >
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> > >
> > >
> > >
> > >
> >
> >
> > --
> > --
> > John Mertic "Explaining a joke
> > is like dissecting a frog: you
> > jmertic@gmail.com understand it better,
> > but the frog dies in the
> > process."
> >
> > -Mark Twain
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
> >
> >
> >
> >
>
>
> --
> --
> John Mertic "Explaining a joke
> is like dissecting a frog: you
> jmertic@gmail.com understand it better,
> but the frog dies in the
> process."
>
> -Mark Twain
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.485 / Virus Database: 269.13.12/997 - Release Date: 2007-09-09 10:17
>
>
>
>


--
--
John Mertic "Explaining a joke
is like dissecting a frog: you
jmertic@gmail.com understand it better,
but the frog dies in the
process."

-Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php