Filemanager.fileexists command

Discussion in 'Jiggy Runtime Development' started by Rocky5, May 4, 2008.

  1. Rocky5

    Rocky5 New Member

    Joined:
    Feb 26, 2008
    Messages:
    254
    Likes Received:
    3
    Device:
    iPhone 4 (Black)
    hi there iam have been looking for examples of this code but i cant seem to find any so iam asking for some help please.

    what iam wanting to do is have it look for some file if it exists then it does a certain part of the code if it doesn't then it does a different part.

    just like the if -e then - else command for terminal but only in jiggy

    i know there is a true and false part of the code but i cant seem to get it to work it always seems to do the part of code that is in the false part no mater what i do.

    if you want the main.js file i will be happy to send you a copy to look over it to see if it is correct.
  2. PAEz

    PAEz New Member

    Joined:
    Jan 29, 2008
    Messages:
    201
    Likes Received:
    10
    sorry my jiggy aint working at the mo so i cant test anything but heres some links that might help...
    http://jiggyapp.com/doc/files/FileManager/FileManager-jsi.html#FileManager.fileExists
    http://jiggyapp.com/download/examples/
    JavaScript
    http://www.w3schools.com/jsref/
    http://www.w3schools.com/js/js_if_else.asp
    hope it helps

    and itll go along the lines of....

    if (FileManager.fileExists("/path/somefile") {
    put in here the stuff ya wanna do;
    if the file exists;
    }else{
    and in here goes;
    the stuff to do if the file dont exist;
    }
    1 person likes this.
  3. Rocky5

    Rocky5 New Member

    Joined:
    Feb 26, 2008
    Messages:
    254
    Likes Received:
    3
    Device:
    iPhone 4 (Black)
    if you were here i would kiss you lol thank you very much this worked a treat in the end it was so damn easy lol.

Share This Page