jekillen Posted November 19, 2015 Share Posted November 19, 2015 (edited) EDITED: While waiting for a reply, I have figured out the solution to this problem: The path info is wrong. All of the sub dirs have an index.php file and '.' and '..' And most have identical sets of directories such as php, js, css, and img. So, I am using scandir() to get the file list but it doesn't provide the necessary path info for each listing. I have to add that for the other functions to find and process the files properly. Maybe some else will see and benefit from this. Hello;I have a project that is run on a FreeBSD server and I am running intoproblems I can't figure out with code that is supposed to list directorycontents in the servers file system, along with user and wrx and octal file perms for each entry.So, the problem is that a directory listing for a directory below the 'home'directory will only successfully list the following:...index.phpany directory (mostly, there is one dir where sub dirs are also not showing up)all other files return errors for function code I have for getting wrx perms.The same is true for results of calls to stat() and other related function codesuch as fileperms().index.php IS a file, so why would the other 'files' fail to produce results?Any ideas? Any similar experience and solutions?Ownership issues? (why would index.php go through with the same ownership and perms?)file corruption?inadequate php ini settings?Sample output follows:Sample of home directory listing (default for the user interface display)Owner type and permissions Octal value Namejekftp d : dir | r w x r w x r w x 0777 .jekftp d : dir | r w x r - x r - x 0755 ..jekftp - : file | r w x r w x r - - 0774 BTO.phpjekftp - : file | r w - r - - r - - 0644 B_shebangInCShell.txtjekftp - : file | r w - r - - r - - 0644 adminUPLD.phpjekftp - : file | r w - r - - r w - 0646 browserDev.txtjekftp - : file | r w - r - - r - - 0644 clear.phpserver - : file | r w - r - - r - - 0644 codeSamples.txtjekftp - : file | r w - r - - r - - 0644 console.phpjekftp - : file | r w - r w - r w - 0666 consoleTestGrid.txtserver - : file | r w - r - - r - - 0644 consoleTestGridCopy.txtjekftp - : file | r w - r - - r - - 0644 console_help.phpjekftp d : dir | r w x r - x r - x 0755 cssserver - : file | r w - r w - r w - 0666 customSelector.phpjekftp - : file | r w - r - - r - - 0644 dirIndex.phpjekftp - : file | r w - r - - r - - 0644 dirLstDev.phpjekftp d : dir | r w x r w x r w x 0777 distjekftp - : file | r w - r - - r - - 0644 editorComments.txtjekftp - : file | r w - r - - r - - 0644 file_browser.phpjekftp - : file | r w - r - - r - - 0644 file_browserEXP.phpjekftp - : file | r w - r - - r - - 0644 file_browser_old.phpjekftp - : file | r w - r - - r - - 0644 file_editor.phpjekftp - : file | r w - r - - r - - 0644 file_editor_help.phpjekftp - : file | r w - r - - r - - 0644 getServerName.phpjekftp - : file | r w - r - - r w - 0646 goForIt.txt====================================================directory listing USING THE SAME CODE with errors:(there were also php related errors appearing in with html above the doctype declaration about fileperms failing that I have supressed with @)Current Directory: dev_lab_current/lab_1Owner type and permissions Octal value Namejekftp d : dir | r w x r w x r w x 0777 .jekftp d : dir | r w x r - x r - x 0755 .. _CONSOLE -> getWRXPerms error: conf_lab_1.php was not found, or is not a file or directory 0 conf_lab_1.phpjekftp d : dir | r w x r - x r - x 0755 cssjekftp d : dir | r w x r - x r - x 0755 imgjekftp - : file | r w - r - - r - - 0644 index.phpjekftp d : dir | r w x r - x r w x 0757 js _CONSOLE -> getWRXPerms error: lab_editor.php was not found, or is not a file or directory 0 lab_editor.php _CONSOLE -> getWRXPerms error: lab_interface.php was not found, or is not a file or directory 0 lab_interface.php _CONSOLE -> getWRXPerms error: lab_reader.php was not found, or is not a file or directory 0 lab_reader.php _CONSOLE -> getWRXPerms error: lab_sampler.php was not found, or is not a file or directory 0 lab_sampler.phpjekftp d : dir | r w x r w x r w x 0777 php _CONSOLE -> getWRXPerms error: text was not found, or is not a file or directory 0 text Edited November 19, 2015 by jekillen Link to comment Share on other sites More sharing options...
john_jack Posted December 16, 2015 Share Posted December 16, 2015 have you tried using opendir and readdir http://php.net/manual/en/function.opendir.php .i used it a while ago it works like a charm. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now