LoWang Posted April 13, 2012 Share Posted April 13, 2012 Hello I don't know where the problem is, but it seems InetGet sometimes just fails to overwrite existing file with a new one from the server. I use it to download an exe file (with flag 1 to force reload from remote site) and I suppose it should overwrite the current file on a disk! To my surprise it does not work on some pcs and it seems I will have to add filedelete before inetget to ensure it really works and downloads the fresh file from a server. There should be no permissions problem because the file is created by the same user under which the script (service) runs and InetGet does not return 0 so it means it probably thinks that it downloads it. If I rename the existing file and rerun the function it downloads it correctly, but from some reason it was not able to overwrite the previous file. When I renamed the old file back and rerun the function it mysteriously was able to overwrite the file! What can cause this? IE version? There is IE8 on this pc. I have more computers with this problem so I may investigate more on it later yet. Link to comment Share on other sites More sharing options...
JohnOne Posted April 13, 2012 Share Posted April 13, 2012 Well it does not specifically mention in the help file that it is supposed to overwrite a file. What is it that makes you think it should? And I don't really think an extra line of code to delete the file first is a massive task anyway. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
LoWang Posted April 14, 2012 Author Share Posted April 14, 2012 (edited) you can't be serious with this Nobody says it is a problem to add filedelete. All I think is that it would be much better if it behaved predictably. Helpfile does not say so, but inetget usually overwrites the file and returns the number of bytes downloaded but sometimes it just does not overwrite the file without any obvious reason but still returns the number of downloaded bytes! This is not good. Of course I would always add filedelete before it if it was clear that the file does not get overwritten. Perhaps there should be a note in the helpfile that developers should not rely on the file being overwritten... Edited April 14, 2012 by LoWang Link to comment Share on other sites More sharing options...
JohnOne Posted April 14, 2012 Share Posted April 14, 2012 Well perhaps it's a bug. But before you open a ticket, are you saying that it works on certain machines and not others? As that suggests a local computer issue. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
kylomas Posted April 14, 2012 Share Posted April 14, 2012 LoWang, A couple questions: - How did you identify that the file was not deleted? - Is it possible that the same data was downloaded consecutively? (making it appear that the file was not deleted) - Can you tell if there is any other access to the file when the download occurs? - How frequently does this happen? - Does this happen across multiple data sources/targets? Thanks, kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now