Hi All, This might seem a very old problem, but I have searched a lot for this and I think I know the problem but I want some clarification for the workarounds that I am planning to implement for this problem --
There are four folders A, B, C, D. I am getting a file in folder A, moving it to folder B for processing, now in folder B I am encrypting that file and creating a file in folder C with the same name (need a backup in B), and then as soon my encryption is complete I move the file from C to D(my output).
I think the problem is with my encryption process and I am leaving some file streams open. Is there any way I can check this? if I am leaving any streams open? any tool, any ideas will help
I have checked each and every line of code and closed all the streams that I could see - I am also checking if the file is writable or not before moving, I am also retrying the moving logic for some time untill it fails....
So finally I am doing this - Copying the file from C to D and then deleting the file in 'C'(but it fails), I want to know from you guys if I am doing the right thingy?? Can I get a safe result or a valid file always if I copy a file with hanging streams.. ??? please help
Thanks in advance ! Regards
Time is what we want the most, but what we use the worst. -- William Penn
: ( I cant use a profiler and I cant share the code : (
FYI - I am using Bouncycastle for encryption.
debugging some more I found out that inbuilt streams in the bouncy library like ArmoredOutputStream, BCPGOutputStream they dont close the underlying streams and etc.... I tried to assign all the streams to null just after closing them in my finally statement...
Should Assigning the stream objects to null take care of freeing the streams ?? because when I tried this the file didn't move : ( please advice.. urgent..!!!