On Tue, Sep 30, 2008 at 11:34:57AM -0500, Peter da Silva wrote: > Why in the name of all that's unholy do programs on Windows generally > unpack or download files to a temporary location and then *copy* > them to the final location, instead of at least *moving* them or > (god forbid) downloading them to the right location in the first > place? > > Even if they're worring about overwriting an existing file, there's > no reason they couldn't download/unpack it to filename.$tmp$65234657 > and then rename it when they're done. They don't need to copy the > scurvy beggar.
I think the rationale behind downloading to tmp is "oh no, the user might try to use the file before it's done downloading and encounter a failure". On windows, this problem can be worse.. "oh no, the user opened the file with a program that doesn't explicitly open it in a sharable mode, and now the file is locked and the download cannot continue." Don't laugh, I've seen it happen. I don't really know why programs close the file they are downloading sometimes, but .. well.. shrug. Of course the corrolary is that if you know what you are doing and you know how to start using the file before it has finished downloading, then there are now a bunch of roadblocks in your way. Irritating. Also, how do you know that it's working? You can't see the file in the place where you told it to download it. Firefox of course "solves" this by lying to you with a 0 byte file that.. wait for it... fails when you try to do anything with it. Meanwhile, $TMPDIR may be on a filesystem without room for the download. Clever. As for the copy vs rename? Maybe there is some reason, but I presume it's just gross stupidity. -josh
