getcwd for current location based on ftp account permission
- by John Doe
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