Accessing Files on Windows Mobile

Greetings,

For a while now, we have a system in our application that can clean up images that are send to and from our RhoMobile application. With this process, we ensure that we reduce the used amount of data on devices to a minimum.

With the update to RhoMobile Suite 4.0 tho, this system stoppen worden on Windows Mobile devices. When the following code executes, the application just crashes without a log note or an error message. Can anyone tell me what is happening here?

Device: Motorola MC65 with Windows Mobile 6.5.3.

Code:

# Make a shortcut for the path

file_data_path = self.join( Rho::Application.userFolder, "workorder_file_data" )

# Check if its a directory

if File.directory? file_data_path

  # Go trough all entries

  Dir.new( file_data_path ).each do |entry|

    # Try and delete the files

    begin

      File.delete( File.join( file_data_path, entry ) ) unless entry == "." || entry == ".."

    rescue

      # Do nothing, we`ll try again next time

    end # End begin

  end # End each

end # End if

Cheers,

Bart

Kutir Mobility
Hi Bart,File API syntax got

Hi Bart,

File API syntax got changed in the RMS 4.0. Please refer this http://docs.rhomobile.com/en/4.0.0/api/File.

Visnupriya R

Kutir Mobility

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Bart Fukkink
Right, I missed that one.

Right, I missed that one. Thanks for the heads up, I got it fixed now


Bart

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments