
-----------------------------------
Omnipotence
Mon Nov 27, 2006 7:01 pm

List Doesnt Fully Write
-----------------------------------
I coded this thing to build a list of every file in a folder (Which would be inputed) and it would number all the files and write it to a .txt file. The only trouble is, the list keeps cutting somewhere 5/6ths of the way (guessing estimate) and I can't seem to figure out why. I checked the number of times the for loop went through and even if the program picked out the last item, but I still cant get it to write. Any ideas?


package javaidetest;

import java.io.File;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.FileWriter;

import javax.swing.*;
import java.awt.*;

public class Main 
{
    
    public Main() {}
    
    public static void main(String[] args) throws IOException
    {
        //String Reader
        BufferedReader InStream = new BufferedReader (new InputStreamReader (System.in));
        //File Writer
        BufferedWriter OuStream = new BufferedWriter (new FileWriter ("Full List.txt"));

        //[Input] Destined Directory
        String DirName;
        DirName = InStream.readLine ();
        File DIR = new File (DirName);

        //[List] Full Folder List
        String[] SortingList = DIR.list ();
        int MArrSize = -1;
        int Check = 0;

        for (int indx = 1 ; indx < SortingList.length ; indx++)
        {
            if (indx >= 1000)
            {
                MArrSize = 0;
            }
            else
            {
                if (indx >= 100)
                {
                    MArrSize = 1;
                }
                else
                {
                    if (indx >= 10)
                    {
                    MArrSize = 2;
                    }
                    else
                    {
                    MArrSize = 3;
                    }
                }
            }

            for (int indy = 1 ; indy = 1000) {
            mArrSize = 0;
         }
         else if (indx >= 100) {
            mArrSize = 1;
         } 
         else if (indx >= 10) {
            mArrSize = 2;
         }
         else {
            mArrSize = 3;
         }

         for (int indy = 1 ; indy 