Results 1 to 4 of 4
  1. #1
    Dieter's Avatar
    Dieter is offline Member
    Join Date
    Sep 2009
    Posts
    91
    Rep Power
    0

    Default Creating files stopped creating...

    Hi,

    i was wondering why files stop creating after 55099 ...

    i know this is useless but i'm just curious about this :p

    is this someting from the security of windows against hackers?

    Java Code:
    import java.io.File;
    import java.io.IOException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    
    /**
     *
     * @author Dieter
     */
    public class Main {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
    
            File example = new File("c:\\temp\\example.txt");
    
            for(int i = 1; i<=1000000;i++){
                try {
                    example.createNewFile();
                    example = new File("c:\\temp\\example" + i + ".txt");
    
                } catch (IOException ex) {
                    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                }
    
                System.out.println("File(s) created!");
            }
        }
    
    }
    Last edited by Dieter; 09-25-2009 at 06:57 PM.
    Programming today is a race between software engineers striving to build bigger and better idiot proof programs,and the Universe trying to produce bigger and better idiots...

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Does it stop with an exception? Do you still have any disk space?

  3. #3
    Supamagier is offline Senior Member
    Join Date
    Aug 2008
    Posts
    384
    Rep Power
    7

    Default

    Do you still have any disk space?
    Extremely unlikely, close to impossible.

    i was wondering why files stop creating after 55099 ...
    Not for me, currently at 60.000 (I'm using Vista). I think it's just the maximum number of files per folder, or... i dno. Protection against hackers is... nah, that's not it - what hacker would need 55k files? xD
    I spose you're not using Vista?

    EDIT: I'm at 100k now... But I have to go, so I stopped the program ;)
    Last edited by Supamagier; 09-25-2009 at 09:18 PM.
    I die a little on the inside...
    Every time I get shot.

  4. #4
    Dieter's Avatar
    Dieter is offline Member
    Join Date
    Sep 2009
    Posts
    91
    Rep Power
    0

    Default

    naw i'm using xp at school and got to 100k at my vista comp aswell but then it just stopped and the next time i run it its more and the third time less.

    so donno whats wrong with it lol. it's kinda weird.

    diskspace isnt the problem cause it doesnt take any space for me, i checked that allready and the files are totally 0 kb per file.

    But ey, the syntax works so its ok for me :) just wanted to try what would happen if i did that, still thx for the reply tho :)

    all the best,
    Dieter
    Programming today is a race between software engineers striving to build bigger and better idiot proof programs,and the Universe trying to produce bigger and better idiots...

Similar Threads

  1. Creating .Jar files
    By Deathmonger in forum New To Java
    Replies: 6
    Last Post: 06-23-2008, 12:59 AM
  2. Creating ZIP files
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-03-2008, 06:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •