Well, really depends what are you after.<br><br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Not seeking for a module.<br>Actually i'm working on a ftp-like file browser and i wonder if the
<br>file browsing could be possible by just querying the DB. Drupal DB has<br>the files but not the directories.</blockquote><div><br>In core only upload deals with files, facing a user. And upload doesn't need<br>directories. The functionality it provides is similar to email attachments.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">What i was thinking about is a {directories} table and an additional<br>"directory" field in {files} table in order to get the files per
<br>directory. We should also change the file_check_directory() function<br>to make it insert the directories it creates to the DB.</blockquote><div><br>No we shouldn't - the fileapi is concerned itself with physical files and their locations. All
<br>db logic should go in extra modules. There are too many different use cases to satisfy<br>all needs acceptably.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
With the current file management in drupal a file browser gets files<br>from DB and requires to scan all files and folders by a physical disk<br>access in order to get directories only. A physical disk access plus a<br>DB hit! I cant think of any other way.
</blockquote><div><br>Not exactly.The directory/file check is just that a check for its existance, no more. The db logic in core <br>is upload's.<br></div><br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
What do you think?<br></blockquote></div>while( true ) {<br>Having directories in db? Maybe, or maybe not. How do you maintain the consistency of the structure in db<br>and the filesystem?<br><br>What if your filesystem is remote? like S3, ftp, ...?
<br><br>How would you maintain the mapping of permissions to files and directories without db?<br><br>Whould you allow non-drupal access to the directory structure? via ftp, ssh, webdav, ....<br>}<br><br><br>You can see that a single solution to solve all problems is tough. Your suggestions have merit, but their are one
<br>of the solutions. I believe there are modules in contrib which do nearly that. They do make compromises, because<br>they target specific use cases.<br><br>I do believe there will be change in that space with D6. It is too early to tell though.
<br>