Results 1 to 6 of 6
  1. #1
    Prime624 is offline Member
    Join Date
    Feb 2013
    Location
    San Diego
    Posts
    96
    Rep Power
    0

    Default Problem with files ending in numbers

    I have a program that uses a text file. The text file is in a folder called "map1". The text file itself is called "store1.txt". The program crashes when trying to read the text file, but has no problem with the folder. It also reads a png file called "1.png" and has no issue. When I change the name of the text file to "storeOne.txt", it works without problems. Why is this?
    Last edited by Prime624; 01-12-2014 at 09:00 AM.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,535
    Blog Entries
    7
    Rep Power
    20

    Default Re: Problem with files ending in numbers

    You have to show us a bit of (relevant) code; your question can't be answered now ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Prime624 is offline Member
    Join Date
    Feb 2013
    Location
    San Diego
    Posts
    96
    Rep Power
    0

    Default Re: Problem with files ending in numbers

    My question is if it matters in Java whether a file name ends in a number or not. Are there any other file naming rules I should know about if I plan to use them in Java?

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,535
    Blog Entries
    7
    Rep Power
    20

    Default Re: Problem with files ending in numbers

    Quote Originally Posted by Prime624 View Post
    My question is if it matters in Java whether a file name ends in a number or not. Are there any other file naming rules I should know about if I plan to use them in Java?
    Java doesn't care about the names of the files or directories; if you want to know the details, have a look at the API documentation of the File class; Java tries to be as file system independent as possible, i.e. both the slash and back slash are accepted as file path separators and it fiddles a bit with root names and UNC names (e.g. C: or ///) but it doesn't care about digits in a file name ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Prime624 is offline Member
    Join Date
    Feb 2013
    Location
    San Diego
    Posts
    96
    Rep Power
    0

    Default Re: Problem with files ending in numbers

    Thanks

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,535
    Blog Entries
    7
    Rep Power
    20

    Default Re: Problem with files ending in numbers

    Quote Originally Posted by Prime624 View Post
    Thanks
    You're welcome and, because you haven't supplied any details of your code, all I can say is: best of luck.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 2
    Last Post: 06-11-2011, 01:54 PM
  2. Problems loading large numbers of files
    By davisburns in forum AWT / Swing
    Replies: 2
    Last Post: 02-25-2011, 04:13 AM
  3. Problem with Ending Craps game
    By Ebayer in forum New To Java
    Replies: 4
    Last Post: 02-11-2011, 07:17 PM
  4. Replies: 11
    Last Post: 01-14-2011, 06:36 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
  •