Java Code in Intel Mac

Discussion in 'Mac Programming' started by mrpersonality98, May 24, 2007.

  1. mrpersonality98 macrumors newbie

    May 24, 2007

    I am in deep deep **** (apologies for the language)

    If anyone can please help.
    I want a code in Java which can work in Intel Mac.
    The code should check for the existence of anything in the predefined location.

    For eg. If I click on a button, it should check whether a.txt exists in C:\JAVA - if yes - it should prompt "File Exist" - if no it should prompt "File Does not Exist"

    I want this today. I would really appeciate if you could help me out in this.
    You can send me the code at my gmail address - the username is vkmittal or you can send it through here

    Remember it should be in Java which runs in Intel Mac

    I would really owe a big time to you.
  2. hsvmoon macrumors newbie

    Jul 31, 2006
    Huntsville Al
    basic code

    Below is the basic code idea you need to use. You just need to add the IO stuff.

    File file = new File("C:\JAVA\a.txt");
    //display a.txt exists
    //display a.txt does not exist
    This sounds like homework?
  3. fishkorp macrumors 68020


    Apr 10, 2006
    Ellicott City, MD
    if you're running it from OS X you'll never get a 'true' value for something with a full Windows Path since no C:\ exists.

    there is absolutely nothing in what you're asking that would be specific to an intel mac over any other java capable computer out there other than you'd need the correct JRE to run and JDK to build.

    why not just Google for Java File IO and i'm sure an example will pop up. it's not complicated stuff.
  4. kiang macrumors regular


    Apr 8, 2007
    Why do you think the Java API exists?
    file.exists() is a standard function in the class File, so if you just went to the API you would have found the answer in like 2 seconds....
  5. mrpersonality98 thread starter macrumors newbie

    May 24, 2007
    Thanx guyz - I think it has helped :)
    Would know the result in next week

Share This Page