Getting all the files on my computer

Hi,
I have written an algorithm which reads my harddrive from root, and goes all the files and folders and stores them in a index. I am using it for a project that gets all the folders and displays them in a explorer like Tree.
heres the algorithm below.
File[] files = new File[10000];  //Contains all the files read
int[] index = new int[10000];  //Contains a position of the root folder that file is in, in relation to files[]
int count = 0;
//---First part of code
count = 0;   //how many files and folders read so far
File[] getfiles = File.listRoots(); //Gets al the root drives
readfiles(getfiles[3]);  //Reads drive (i read my E:\ drive as its the smallest)
//--- Second part of code
private void readfiles(File folder) {
      File[] getfiles = folder.listFiles();   //gets files within that folder
      int i = 0;                         //for looping        
      int fold = count;             //Remebers this number as it has the index for the folder the files contained in
      while (true) {
        try {
          files[i+count] = getfiles; //saves the file details
index[i+count] = fold; //Saves the index of the folder it is contained in, so that it can be easily positioned in a tree
if (files[i+count].isDirectory()) {    //checks if directory
readfiles(files[i+count]); //repeats the loop wih the new folder
i++;
} catch (IndexOutOfBoundsException ioobe) {break;} //no more files to read kills the loop
count = count + i; //updates the count to stop writing over data
Hope i have documented it ok,
Heres the problem.
When i run it, it works perfect, but i see no folders, just files. I think my algorithm is writing over it but i tries and i get "null" errors when reading the data in other bits of code.
OK, well thanks in advance
I can post the whole code if needed but its kinda messy as i have left code in there for reference.

I wanted to index the whole drive for 2 reasons...
1. So that it can be put into a tree, so that the user
can go through the files as if they were using the
windows explorer tree menu thingyBut you don't need to put the whole file hierarchy into a single data structure to do that.
2. My program is going to be a back up program, and it
would use the index for comparisions and stuff.OK, but I'd suggest in this case, you may want to consider whether you need the whole thing in memory at a single time. It may be easier to compare recursively between dynamically created/loaded values. I suppose it'll depend on how you store the survey between invocations of the program.

Similar Messages

  • Just got a new mac computer and none of the music from my old computer's itunes transfered when I transfered the contents of the hard drive.  Now I'm trying to transfer music from my ipod and can't get all the files....help?

    Just got a new  computer and none of the music from my old computer's itunes transfered when I transfered the contents of the old hard drive.  Now I'm trying to transfer music from my ipod and can't get all the files....help please?

    The iphone is not a storage/backup device.
    It has always been very basic to always maintain a backup copy of your computer for this very occasion.
    Have you failed to do this?
    If so, not good, then you can transfer itunes purchases:  File>Devices>Transfer Purchases
    You may be able to purchase a third partyn program to get the rest ( not supported by Apple)

  • Need to get all the files, well music and video, from my ipod touch 5th gen to my itunes libary.

    Need to get all the files, (well music and video), from my ipod touch 5th gen to my itunes libary. (So basically sync the other way to normal)
    Laptop hard drive broke so had to buy a new one and obviously now need to sort out my itunes.
    Did try downloading all my purchased stuff onto itunes but it has missed some things off, and there are some files I did not purchase from itunes so need a way of getting them back on there.
    Sure this question has been asked a million times but can't find anything to help me on here so thought I'd ask.
    -Did have a look at going onto the start menu and opening the hidden items thing but couldn't see any reference to ipod or device on it so wasn't sure how to do it that way.
    -On itunes under my device when its connected, the section about manually restoring and backing up, would that help me? Because that says it will manually back up my ipod to my computer then could restore that back up, obviously I don't want to accidnetally get rid of everything on my ipod so didn't want to try that just in case without checking.
    (And yes I have disabled auto sync to device when conncected!)
    Can anyone help me please? Sorry if i've overcomplicated this!
    Thanks:)
    Chris

    Backing up an iOS device will copy some data to a backup file within iTunes, but this excludes all media.  You can also transfer iTunes Store purchases from the iDevice to iTunes but, without using a third-party tool, nothing else.  As long as you do not sync the iPod with your new library, the media that's on it will remain ... for as long as it keeps functioning, is not lost, stolen, eaten by the dog, ...
    You may also have an option to recover your previous library from your old laptop; as long as its hard drive isn't fried, a computer repair store or technician may be able to extract the drive, mount it in an external enclosure, and copy your data to another PC.  Whatever you choose, there is no real alternative to having all your media on your computer, managed by iTunes, and regularly backed up to another device/location.

  • I bought a new laptop how do I sync my ipad and get all the files synced to my old laptop

    I bought a new laptop. Can I sync my ipad to it?  And how do I get all the files that were synced to my old laptop?

    Do you still have your old computer with your media (music, films, etc) on it so that you can copy them over from it ? If you do then there are a number of methods on this page for how you could copy it over from it : http://support.apple.com/kb/HT4527
    If not, and if you don't have your content elsewhere (e.g. music that wasn't bought from iTunes), then there are some programs listed half-way down this page for how to copy content back from a device : https://discussions.apple.com/docs/DOC-3991
    For iTunes downloads you should be able to copy them from your iPad via File > Devices > Transfer Purchases
    Also see this page for syncing to a new computer : https://discussions.apple.com/docs/DOC-3141
    If you want to copy files/documents from the iPad then how you do so depends upon what app that they are in and what the app supports e.g. file sharing on the Apps tab in iTunes, transfer via your wifi network, email, dropbox etc

  • 2006 iMac running 10.4 OS. I copied files to ext. drive. Put in 10.6 disc and did a clean install (format) of 10.6. Copied data from ext. drive back to Mac. I didn't get all the files. CAN I REVERT BACK TO THE 10.4 OS SO I CAN COPY MY DATA PROPERLY?

    2006 iMac running 10.4 OS. I copied files to ext. drive. Put in 10.6 disc and did a clean install (format) of 10.6. Copied data from ext. drive back to Mac. I didn't get all the files. CAN I REVERT BACK TO THE 10.4 OS SO I CAN COPY MY DATA PROPERLY?

    How did you copy files to the external drive, and what files did you copy? Did you drag and drop in the Finder? Use a clone utility? What files did not successfully copy?
    If you reformatted the drive as part of your install, then you won't be able to recover any files from the drive. Reverting back to (reinstalling) 10.4 will not help you.
    Do you have a complete-drive backup of your old system?
    Matt

  • How to sinc two computers and get all the files from both

    Not sure if this is the right forum for the issue, but... I have a iMac G5 and a MacBook, and I use one or the other for my work. That way I get part of my work on one, and other part on the other Mac. Now, I would like to sinc both of them, so that I have all the files from iMac on the MB, vice versa. I know that I could go slowly and use an external hard drive, copy files from one computer, save on another, but is there any handier and faster way to do it?
    Thanks
    Zo

    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh664.html
    http://docs.info.apple.com/article.html?artnum=106461

  • How do I get all the files from the hard drive in non-working Compaq Presario CQ62-411NR

    Spilled iced tea into the keyboard of notebook and after drying out it will not power on. If I try a hard restart it is indicated that i would lose all the info in the memory and I can not afford to lose the photos of my mother that are on the hard drive. Is there a way of getting the hard drive to work in some other fashion so that I can get my photos and other files.
    This question was solved.
    View Solution.

    Very happy to help.Valued family photos are a treasure.
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • New computer, how do i get all the music from old computer into new itunes?

    subject said it all. how do i get the music from my old computer and my ipod into the new itunes account on my new computer. i'm stinkin confused.

    Easiest way is to copy the entire iTunes folder onto an external hard drive and then copy it onto the new computer. Google your query. Lots of step by step instructions out there

  • I need to download Captivate 7 so I can re-install it because I lost all the files in a computer crash

    My computer crashed and I had to reinstall windows. In the process I lost everything including the install files for Captivate 7. I would like to download them again but I cannot find them, only Captivate 8.
    Can I download the Cp7 files so I can reinstall my original version and continue working with my files please? Thank you

    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5.5, 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • How we can get all the files in FTP folder

    Hi all,
    My requirement is need to retrive text files from FTP folder to application server.
    For this i am using FTP_SCRAMBLE
                                FTP_CONNECT
                                FTP_COMMAND function modules.But i dont know how we can access particular folders and all files in Particular folders.For this i dont know the process and is there any commands to see all files in a folder.
    Very Urgent...
    Thanks and Regards,
    Siva.

    Hi,
    Check the link below:
    Re: How can we upload a file from ftp server
    hope this helps.
    regards,
    Sharath

  • Is possible search all the files in one folder and get list all with the same extension.??

    Hi,
    I would like to get, if it is possible, do searching in one determinate folder and get all the files with the same extension, For example, Give the *.pou and get all the files on one list of the files in this folder and sub-folders...
    If it is possible i would like to see any example.
    Thanks a lot, Fonsi.

    Hi Dennis,
    I got your advise, I download the openG (i had problems, and downloading directly and install one to one).
    Ok, i got but i have one problem, which i can't solve. I entry the promt  to search and put the directory to save, later i push 'Do it' and it search the files, show the paths and number, then save in the folder and finally show the window , all ok!.
    The problem is with the target path, when i want use the browse, it doesnt run properly. I want select one carpet, and it demands one file, i dont understand why??, i changed the options browse but it didnt work. Also i would like when i put one path if folder doesnt exist, directly create it and save the files, if exist copy it.
    Thanks for all!. I attached the file in lv 7.1
    Attachments:
    buscar3.vi ‏50 KB
    capture.GIF ‏48 KB

  • Is there a way to list all the file names (automatically) in a folder to dynamic text box?

    Hi,
    I would like to know whether FLASH AS3 has some option to get all the files names from a folder specified and show it in a dynamic text box? Whenever some new files added to this folder it should update the list accordingly.
    Thanks for any information in this regard.

    Not particularly experienced in this field myself, but I've found its just easier to implement an XML file which lists the contents of the folder. It just means that when you upload a new file you have to add it to the list in the xml file also. No real hardship once you figure out the mechanics of it

  • Can someone upload all the files in iPod_Control folder?

    I need to get all the files from the iPod_control folder especially the one that is in the \iPodcontrolgamesRO. I've accidentally deleted those files that caused my games corrupted. Could someone just upload a .zip file of it. I really really need it. Hope that someone could help me. thanks !

    Originally Posted by spond
    Aspirer,
    you can just re-run the install, and specify only the PXE component -
    that way you will get the correct version
    Shaun Pond
    Our company use ghost for a long time.
    Now I am trying to persuade my IT boss to replace to the ZENworks one.
    So I can only test from my site.
    by adding ZEN pxe boot menu to existing pxe boot menu.
    Thanks anyway.

  • If I restore My Mac OSX Snow Leopard can I get all my files back from a time machine backup made on a portable hard drive?

    I want to restore my MacBook Pro running Snow Lepoard, I made a time machine backup on a portable hard drive, can I get all the files back when resseting the OSX from the Hard Drive?

    If you're using the Mac App Store version, there is initially no clean install option unless you're running the installer on a different drive or partition; your existing data will remain as is. If you're doing it from Lion's recovery partition or using the USB flash drive after erasing the internal drive, yes.
    (64046)

  • I have a FCP event and project with all accompanying media saved on a harddrive.  I am now attempting to open the files on another computer that also has FCP X.  I cannot figure out how to get it to open.

    I have a FCP event and project with all accompanying media saved on a harddrive.  I am now attempting to open the files on another computer that also has FCP X.  I cannot figure out how to get it to open.

    The events and projects folders have to be on the top level of the drive for FCP to recognize them.

Maybe you are looking for

  • ITunes freezes downloading app updates

    I'm running 10.5 (141) on my iMac running Lion and am running into a problem where iTunes will constantly freeze when I download my app updates.  If I download updates individually, there doesn't seem to be a problem and if I turn off simultaneous do

  • Air Errors on SLED 10 errors

    I'm having a problem reported previously in the Adobe AIR for Linux forum, but I don't see a resolution there. Specifically, I downloaded the installation and ran it about a month ago and when I try to execute the adobeair_linux_b1_091508.bin file, i

  • Problems found after checking database configuration of server

    Hello all, Though this problem has been addressed before. . I couldn’t get a clear idea. I get the error. . "Wrong Server Collation; J2EE installation requires SQL Latin 1 General CP850 Bin 2 Collation. MS SQL Server Patch is too low; please read the

  • Expanding/Enhancing a table cell contents

    I have a search utility that shows my database query results in a read-only table. Say this table T has columns C1-C5 and rows R1-R5. Data returned in column C3 has a VARCHAR count between 2000-4000. Currently the table only displays somewhere in the

  • My develop mode is disabled

    i have a photo cc plan Lightroom and photoshop which says the trial  has expired and my lightroom develop mode does not work no can i start photoshop