PHP

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • chown(), chgrp()

    2 answers - 445 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Is there a way to find out if a file can be chownd or chgrpd ? Something
    like is_writeable() Except that youre trying to find out if you can
    change the or Group of a file.
    Rahul S. Johari
    Supervisor, Internet & Administration
    Informed Marketing Services Inc.
    500 Federal Street, Suite 201
    Troy NY 12180
    Tel: (518) 687-6700 x154
    Fax: (518) 687-6799
    Email: rahul (AT) informed-sources (DOT) com
  • No.1 | | 233 bytes | |

    Rahul S. Johari wrote:
    Is there a way to find out if a file can be chownd or chgrpd ? Something
    like is_writeable() Except that youre trying to find out if you can
    change the or Group of a file.
    Who will say it first?
  • No.2 | | 975 bytes | |

    At 11:01 AM -0400 9/19/06, Rahul S. Johari wrote:
    >Is there a way to find out if a file can be chown'd or chgrp'd ? Something
    >like is_writeable() Except that you're trying to find out if you can
    >change the or Group of a file.


    fileperms() perhaps?

    You'd have to compare the return value against the uid/gid the
    webserver runs as, which can be obtained via getmyuid()/getmygid():

    Alternatively, you could check if the file exists, then attempt to
    chown/chgrp it. If the chown()/chgrp() returns false, you probably
    don't have permission.

    steve


    >Rahul S. Johari
    >Supervisor, Internet & Administration
    >Informed Marketing Services Inc.
    >500 Federal Street, Suite 201
    >Troy NY 12180
    >
    >Tel: (518) 687-6700 x154
    >Fax: (518) 687-6799
    >Email: rahul (AT) informed-sources (DOT) com
    >

Re: chown(), chgrp()


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 1 =
QUESTION ON "PHP"

EMSDN.COM