I’m not sure about your setup, but this is probably because you don’t just have access to the filesystem on the target server. So let’s say the FTP server is set up to serve content from /var/ftp-files or something. When you ReadDir /libs it’s going to look for /var/ftp-files/libs on that server. I mean - you obviously wouldn’t want ftp clients to have access to your entire filesystem right? Anyway, it could be any number of things but this is my best guess.
Yes but in this case how I can get a folder located at root of ftp server but not at root of Linux server. (The folder is located in /home/user/ but ftp user can acess only /home/user/ he can t see /)
I would try logging in with a FTP client and checking to see if you can access that folder as a troubleshooting step. I think your code should work as long as that is a valid directory that the client has access to.
The theory is to either use relative pathes to navigate the hirarchy, or to ask the server for a PWD after connection and construct absolute pathes from that.