getcwd for current location based on ftp account permission

Posted by John Doe on Stack Overflow See other posts from Stack Overflow or by John Doe
Published on 2010-05-04T16:33:06Z Indexed on 2010/06/13 8:02 UTC
Read the original article Hit count: 244

Filed under:
|
|

Hello. I'm trying to make a small script that's changing the permission for specific file using a ftp connection. My problem is the absolute path. I have a ftp account wich land on the script directory (/script/). If i'm using getcwd, it will return the whole path (/home/user/public_html/script) but i need only the difference between the full path and the current path (getcwd path: /home/user/public_html/script/ ftp landing path: /script). So, how can i use getcwd to get the current directory for a ftp account? For example, if the user is landing in public_html, the path to the script will be /script/, or if he is landing inside /user, the path will be /public_html/script. Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about ftp