# C:\\WINDOWS\\Temp : can I dump it?

**URL:** <https://boards.straightdope.com/t/c-windows-temp-can-i-dump-it/477048>\
**Category:** Factual Questions\
**Created:** [December 13, 2008, 8:55pm UTC](https://boards.straightdope.com/t/c-windows-temp-can-i-dump-it/477048 "2008-12-13T20:55:22Z")\
**Posts on this page:** 4\
**Page:** 3

<div class="post-metadata">

**Author:** ![Harmonious\_Discord](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@Harmonious\_Discord](https://boards.straightdope.com/u/Harmonious_Discord)\
**Post date:** [December 20, 2008, 2:14am UTC](https://boards.straightdope.com/t/c-windows-temp-can-i-dump-it/477048/41 "2008-12-20T02:14:15Z")

</div>

I don’t know why you are buying cloning software. There is free dependable stuff out there.

---

<div class="post-metadata">

**Author:** ![Mr.Slant](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@Mr.Slant](https://boards.straightdope.com/u/Mr.Slant)\
**Post date:** [December 20, 2008, 2:20am UTC](https://boards.straightdope.com/t/c-windows-temp-can-i-dump-it/477048/42 "2008-12-20T02:20:48Z")

</div>

I’ll second Harmonious’ comment, if my opinion matters.

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [December 20, 2008, 12:46pm UTC](https://boards.straightdope.com/t/c-windows-temp-can-i-dump-it/477048/43 "2008-12-20T12:46:41Z")

</div>

> [@Kobal2](#):
>
> > [@Musicat](#):
> >
> > Do you know how common it is for programs to create junk & work files that they never delete even if not interrupted? Very. They get scattered all over the drive. This kind of clean computing doesn’t seem to be important to most programs.
> 
> Be that as it may (and indeed, it’s very frequent), that’s just bad form. Just because the norm for coders these days is to not optimize their code for mem and disk usage anymore doesn’t make their half-assed efforts good and proper.

I totally agree. I was just pointing out that your concern for cleanliness in one case is overwhelmed by other cases that you have no control over.

> [@Kobal2](#):
>
> > [@Musicat](#):
> >
> > The easiest solution (for file downloading) is to name the temp file something distinctive, like an extension of “$$$”. Then a periodic sweep of all files of this type will turn up any orphans and all can be deleted.
> 
> But such sweep will take longer than the 10s needed to copy a file from TEMP to E:\dad\work\archives\porn, wouldn’t it ? Especially for larger drives. I admit I’m not filesystem guru though.

But I am, or used to be. A periodic sweep of an entire drive can be done quickly\* and without operator attention, and need not be done frequently, but by choice. Downloading large files the MS way forces me to wait for several minutes for each file; it’s both CPU and disk intensive, so it hogs the system; and I have no choice. There’s no comparison.

> [@Kobal2](#):
>
> > [@Musicat](#):
> >
> > In fact, you don’t even have to rename it at all. Just download to the final file name and be sure to lock the file until the download is complete. The only drawback to this scheme is that a directory listing in the middle of a download will show that file as existing, but with the wrong size and not openable. BFD.
> 
> Some peer-to-peer softs I used went that route, in fact they created a file that used the final name and actually used the total, completed space as soon as the download started (I assume they generate a field of zeroes that are progressively written over by the downloaded data, or something to that effect).

It’s unlikely they wrote ANYTHING to the space first. They just changed the directory entry for that file to allocate space and set the file length in the directory to match the desired final number. That action is a million times faster than writing the actual data.

And REALLY good routines will make ONE call to the directory update routine, then write ALL the data, then make ONE call to the directory update to close and release the file. In contrast, the slow ones call the directory to get a single block of space allocated, write one small block of data, then repeat the process until done. The amount of head movement, which is thousands of times slower than sequential disk access, for this latter scheme, is excessive and unnecessary.

> [@](#):
>
> I always thought it was a crappy way of doing things, because short of opening the peer-to-peer program itself, I have no idea whether the file is useable or not.

If you need to use the file, try. If it is in use, it will be locked, and you can’t. You can’t use the temp file or the destination file in the MS method any earlier, but in the schemes I recommend, you finish sooner and the file is available sooner.

> [@Kobal2](#):
>
> > [@Musicat](#):
> >
> > And I don’t know of any basic system routine that “flushes the TEMP directory regularly,” although I’m sure there are some aftermarket routines that include that in their bag of tricks. Either way, it’s an extra step that isn’t needed and a decision the user shouldn’t have to bother with.
> 
> It was my understanding that Windows “Not enough space, do you want me to clean the disk ?” routines did that, but I may be mistaken - I never trusted those _not_ to clean unorphaned files and bork my stuff, so I’ve always done things by hand.

There’s difference between something that periodically performs an action and one that executes only upon some system trigger like getting a “disk full” message. And if I ever get a “disk full” message, the cleaning options won’t help because there’s nothing to delete (I don’t use a recycle bin). In fact that’s a typical MS way of handling things – not checking to see if the routine they propose will do anything useful before prompting the user, like this:

“Do you want to delete unused files to gain space? (Amount of space you will gain = NONE)” :rolleyes:

* * *

- Only if the routine is efficiently written, so that pretty much excludes Microsoft. (OK, OK, I have very little admiration for MS’s technical skills, so sue me.) For example, their delete routine for IE temp files or cookies would win a prize if they gave them out for the slowest in computerdom. Any hacker could write one a thousand times faster, and they have.

---

<div class="post-metadata">

**Author:** ![Kaio](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@Kaio](https://boards.straightdope.com/u/Kaio)\
**Post date:** [December 20, 2008, 8:09pm UTC](https://boards.straightdope.com/t/c-windows-temp-can-i-dump-it/477048/44 "2008-12-20T20:09:18Z")

</div>

> [@Harmonious\_Discord](#):
>
> I don’t know why you are buying cloning software. There is free dependable stuff out there.

Because I haven’t the first clue about cloning. Guy2 recommended some stuff and then left me high-and-dry. I have no idea what I’m doing, which is why I’ve been asking questions. I’d love to have someone with solid experience on this come over and walk me through it, but since Guy2 bailed I don’t know anyone who can.

[Previous page](https://boards.straightdope.com/t/c-windows-temp-can-i-dump-it/477048.md?page=2)
