i wrote an app which opens pictures stored on hard drive, to a picture album, and what i want is that when i want to save the album, cannot overwrite the existing files, because "they are in use by another process" (by the app itself), so is there any method to "dispose" the files from the app first, to be able to delete/overwrite them?
Not sure how you may be doing this but if you are not editing the pictures then there is no reason to save one that already exists. That would just slow down the program and serve no real purpose. You should add some code to see if the picture already exists at the given location and if so then do not try to save it again,
I think if I were going to do an album I would have all my pictures stored in one location and then use a text file for each album to hold the filenames of the pictures and the order they should appear. This would mean that I would not have to save images when they are placed in a album just the filename and would allow the same picture to appear in more than one albumn or more than once int he same album while not needing to have more than one copy of the actual picture.
i`ve made as you said, to check if the picture exists, and save only the non-existent images, works great but it also represents an issue:
the albums and the pictures are stored in an object array, something like this:albums(album_id, picture_id) as object
the files are saved as (album_id, & "_" & picture_id, & ".jpg"), so the first picture of the fist album is 0_0.jpg
the problem with your method is that if i delete a picture, the id of that picture will get the id of the next picture, and so, and if i save the album without the picture i`ve deleted, it must overwrite the name of all pictures after the deleted one, (open them for write), but they are still open by the app itself, so the same problem occurs again.
I think it would make more sense to have a seperate file for the album that holds the filenames of the pictures that are to be included. Should be very easy to do and would solve your issues as well as allowing you to be able to add the same photo to more than 1 album without needing to have more than one copy of the image. Seems like a no brainer.