Menu

#8 Map update is not finished due to file handle

1.0
open
nobody
None
2020-04-28
2020-04-13
Anton Saber
No

Hi!
I am using this program to manage my offline maps for my Android app "OsmAnd". Unfortunately the freshly downloaded maps do not replace the old ones. After update, I have to old and the new one. I have to close offroad and do the renaming manually.

Apr 13, 2020 4:36:18 AM net.osmand.plus.download.DownloadFileHelper$1 reconnect
INFORMATION: OK 200
DOWNLOAD WARNING: I/O Fehler aufgetreten: old file can't be deleted

I have tried to delete the old map manually directly after download, and noticed that there is a file handle from java process. Very lickely the file handle was created to read from the map.

Is it possible to get rid of the file handle and change the way the map is loaded? If maps can be deleted while app running, the map update would be much more comfortable. I would appreciate it a lot!

Thank you for this simple and useful tool.

Discussion

  • Christian Foltin

    Hi,

    hm, for me, it works. Can you send a console output of such a download, please?

    TIA, Chris

     
  • Christian Foltin

    Hi, a complete console output would be helpful.

     
  • Christian Foltin

    Which OS, which java version are you using? Maybe a file rights problem??

     
  • Anton Saber

    Anton Saber - 2020-04-14

    win10 x64

    java version "1.8.0_241"
    Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
    Java HotSpot(TM) Client VM (build 25.241-b07, mixed mode, sharing)

    File permission is not a problem. When I try to delete a map while offroad is opened, I get an error stating "...is opened by Java (TM) Platform SE Binary. Close and retry...".

     
  • Anton Saber

    Anton Saber - 2020-04-14

    Attached complete console output. I have craeted a soft link from user home to another hdd.

     
  • Christian Foltin

    Hi,

    I published something that maybe fixes your problem. Are you able to fetch it from git or should I try to publish some binaries?

    HTH, Chris

     
  • Anton Saber

    Anton Saber - 2020-04-19

    I've never built such a project. Binaries would be highly appreciated.

     
  • Christian Foltin

    Hi,

    let's try this inofficial beta version I've put here.

    HTH, Chris

     
  • Anton Saber

    Anton Saber - 2020-04-19

    I've renamed the old jar file in installation folder and copied your beta release to this folder. Neither started from commandline nor started directly as Java executable I could delete the map. As a consequence the update did not work.

    As you can delete maps while the app is started, should I start the app somehow different? Or add some parameter? Do I need to run it as admin?

     
  • Christian Foltin

    Please start it on the command line and paste the output here. Thanks.

     
  • Anton Saber

    Anton Saber - 2020-04-19

    Alright, here we go.

     
  • Christian Foltin

    Hi, if you try to do it as admin, it cannot harm. BR, Chris

     
  • Anton Saber

    Anton Saber - 2020-04-28

    Admin rights did not help. Should I use a certain Java version or cmd in command line except "java -jar pathToJar"?

     

Log in to post a comment.

MongoDB Logo MongoDB