4 Replies Latest reply on Jul 3, 2015 6:11 PM by CMata_Intel

    Read size of file on sd card on intel edison



      I have a file on an sd card on an edison.

      I have preciously been able to read this file using an sfpt session. Now i would simply like to get the size of the file.

      It is located at /media/sdcard/file.txt


      I am trying to use:

      Session session = jsch.getSession(user, host, port);


          session.setConfig("StrictHostKeyChecking", "no");

          //   System.out.println("Establishing Connection...");



              File f = new File(remoteFile);


              long v = f.length();

              String pv = String.valueOf(v);

              System.out.println("Free space " + pv);



      but it is returning as 0.

      I'm not sure if this is because I am not looking for the file in right place when i do File f = new File.

      any other ideas?