View Full Version : Got a question...
XMEN Ashaman DTM
08-11-2004, 12:21 AM
Is there a way to take all the files and folders in a directory (say something that is close to 100,000 files and directories) and index them with a script?
I know that java can do this (sort of), but I'm not able to put a java applet in the directory to do what I want. I can definitely do it in C, but that means compiling it at work (can't transfer exe's over the local net). I am pretty sure that perl can do it, but I'd rather not have to learn that. :(
Any ideas?
I'd like to be able to locate files in any subdirectory of the folder I'm in, without having to put a index, or dat, or any files in those subdirectories. I'd also like to be able to search the files for keywords (or at least search the info stuff that you can mouse over and get when using explorer... so that I can get all the files having to do with writing reports, or written by me, or whatever). I'd also like the thing to use an html interface so that all the less-knowledgeable people can us it... and it makes it easy (open up explorer and go to the folder where the html is at).
I'm thinking a scripting language is the way to go so that I don't have to worry about hunting down a compiler. And the machines that I'll be working on have native java support, but only for approved packages. ;)
Ghryphen
08-11-2004, 08:39 AM
php and mysql could do it very easily. You can create a php script to recursively check all the folders for files and index them in a mysql database; not sure about searching the individual files for keywords. Not sure what systems you are working with.
Can't wait for Windows Longhorn? It will index files in pretty much the way you are describing using an sql database to store the information. hehe
XMEN Ashaman DTM
08-11-2004, 08:43 PM
The clients are win2k. The physical machine where the directory is at does not say what it is running. I'm assuming windows 2k server. I would not be able to install a compiler or any programs... does php require that sort of thing? If I remember correctly, perl does.
Ghryphen
08-12-2004, 09:39 AM
Yeah, it would take some extended installation. So you see like a shared folder and all the subfolders and files contained within? So you want to index these either on that same machine and host an html interface on that same machine.
Here are some ways.
1.) Index all the files on server, host index on server, allow html based management hosted from server. Result: you would have to install some webserver applications, php, mysql which will need some executing.
2.) Run a program on your own machine which gathers all of the files and folders and saves that information local to your computer, which then could (a) host a web interface from this same user computer; this would be subject to the same installation needs as the server (b) use the same application that gathered the information to search and organize that info; this would need the app to be placed on each computer, plus finding the application. Which would probably be some kind of executable program.
2b would be the easiest, I am sure there are applications out there that index directories and allow quick searching and management, however you would have to be able to install it for each person who needs it.
Tell me if I am warm with any of these scenarios. I am still a little confused about exactly what you need and what your limitations and setup are.
XMEN Ashaman DTM
08-12-2004, 08:46 PM
Number 2 is closer to what I need. I can read and write files to that directory. But not to the others. I've looked at some vb stuff that does what I would like... but it needs to be compiled. :(
So today I was looking at some javascript. The only problem with that is that I'm not sure that there are ways in javascript to read what the files are.
Gambit
08-14-2004, 01:28 PM
Um, if you can get to a command line, you can run dir /s at the top-level you're interested in and it will list all the files from there down, inside their directories. Then you can redirect the output to a text file (dir /s > textfile.txt) and search it with any text editor, or convert it into whatever format you need, such as HTML.
The files' metadata is a little harder, since that's strictly windows extended info. You might be able to manage something with windows scripting, but I dunno.
XMEN Ashaman DTM
08-15-2004, 12:57 AM
Hmm... I don't think I'll be able to run windows scripts. I'm having a hard enough time getting an applet I wrote in java to access the files properly without setting off security alarms.
Also, the dir /s thing was thought of. The problem is the directory is HUGE (think several hundreds of GB of data, and several TB more on the way). The directory is also dynamic, meaning that after you run dir /s at the command line, twenty files could have changed. I suppose I could just run it daily and update the html accordingly....
I'll have to think about that Gambino, because that would be MUCH easier than trying to setup a properly secured java applet.
vBulletin® v3.7.0 Beta 4, Copyright ©2000-2024, Jelsoft Enterprises Ltd.