Hi! I want to get the path in a module I've created but I have some kind of problem with it. It just works like the ordinary "pwd", and in 30% of the cases it works like it should, but in the rest, it doesn't return anything at all.
if ((buffad = (char *)malloc((size_t)sizead)) != NULL) ptrad = getcwd(buffad, (size_t)sizead); That is the call that is made, and buffed is a char *, as well as ptrad. sizead is a long. Can this be a problem with permissions or something? The only cases that it do work for is when theres a more advanced script that is called, such as a forum or a blog (phpbb or wordpress in example). For normal, static html pages, it just returns "/" instead of the real path. I've checked all the paths by writing each request to a file so I manually can check them. I can't see why it should have anything to do with permissions, but since it does work in some cases but not all, that's my first thought. I would love all kind of help here! Feel free to ask anything, I'll try to answer as good as I can! I've tried on all kind of forums, irc-networks and mailing lists with no luck, but I guess this is the "right" place :)