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

    Read size of file on sd card on intel edison

    c.....f

      Hi.

      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.setPassword(password);

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

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

          session.connect();

       

              File f = new File(remoteFile);

            

              long v = f.length();

              String pv = String.valueOf(v);

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

              System.out.println();

       

      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?

      Thanks