How to read a JPEG



  • Just came across this code while debugging the JPEG-reading routines in a program. This is the old code -- the stuff my new code is replacing.

    	FName 	bmpname;
    	FilePtr	bmpfile;
    	Char	command[STR_DEFSIZE];
    
    	/** use djpeg to convert the JPEG file to a BMP file **/
    	MakeTmpFileName("ndima", bmpname);
    	STR_NCat(bmpname, ".bmp", STR_DEFSIZE);
    	STR_Sprintf(command, "djpeg -bmp %s > %s", 
    		GetRealName(bbuf), (CStr)bmpname);
    #if OS == OSUNIX
    	(void)CRTL_system(command);
    #endif
    
    	/** read the BMP file **/
    	bmpfile = FILE_New((CStr)bmpname);
    	if (FILE_TryOpen(bmpfile, FILE_IOREAD, FILE_FMTBINARY)) {
    		IMAGE_FileRead(image, bmpfile, IMAGE_FileFmtWindowsDib());
    	}
    	FILE_Dispose(bmpfile);
    
    	/** remove temporary BMP file **/
    	DeleteFile(bmpname);
    


  • Hey it actually cleans up after itself! That is quite possibly the first time I've ever seen a program actually clean up it's own temp files.

    dir %TEMP%
    

    Try it, especially if it's on some non technical person's computer, craplets love %TEMP%
    </rant>



    As for actual wtfs, only on unix is the bmp actually made, bmpname is buffer checked, but command isn't, error handling doesn't do anything, disposes of fp even if it didn't open it, deletes bmp even if it didn't make it.



  • I was able to find the library being used:

    http://www.empresent.com/EmPresent-Documentation1/EmP-Doc-4_01/EmPresent_Help_Library/GUI_Helper_API_Guide/GUIHelperAPI_9_Image_Class/GUIAPI_9_ReadWriteImgfrmFile.htm#FileRead

    but I can't be arsed to look up what file formats it supports.  If it doesn't natively include JPG, though, then the library is the WTF.

     



  • @emurphy said:

    I was able to find the library being used:

    but I can't be arsed to look up what file formats it supports.  If it doesn't natively include JPG, though, then the library is the WTF.

     

    Actually, you didn't, but it would be interesting to know if EmPresent is pirating the library, or is licensing it.



    The code's got another bit of a WTF in the comments: the history indicates that it was written in early 1987, but the Independent JPEG Group didn't release the standard until 1992.



  • @Lingerance said:

    dir %TEMP%

    @my computer said:

    08/22/2007  09:52 AM        68,512,140 clipboardcache
    08/22/2007  09:52 AM        14,640,976 clipboardcache-1
    08/22/2007  09:52 AM        68,512,140 clipboardcache-2
    08/22/2007  09:52 AM        14,640,948 clipboardcache-3
    08/22/2007  09:53 AM        68,512,140 clipboardcache-4
    08/22/2007  09:53 AM        14,640,948 clipboardcache-5

    Yes, multiple clipboard caches 65MB in size  From 4 months ago.  400MB total in there.  Over one gig if I include subfolders.  And that's my work machine.  Can't wait to see how much space is being wasted on my home machine.



  • $ sudo du -h /tmp
    [sudo] password for user:
    4.0K    /tmp/orbit-user
    4.0K    /tmp/.ICE-unix
    4.0K    /tmp/ksocket-root
    4.0K    /tmp/kde-user
    4.0K    /tmp/.X11-unix
    4.0K    /tmp/kde-root
    4.0K    /tmp/plugtmp
    4.0K    /tmp/ssh-GHJiAS2967
    4.0K    /tmp/ksocket-user/artsd-samples
    36K     /tmp/ksocket-user
    8.0K    /tmp/gconfd-user/lock
    12K     /tmp/gconfd-user
    92K     /tmp

    Evidently Linux programs are better behaved. Or their just sticking their 'temporary' files somewhere else. BTW /tmp is not a tmpfs mount.



  • @m0ffx said:

    $ sudo du -h /tmp
    [sudo] password for user: hunter2
    4.0K    /tmp/orbit-user
    4.0K    /tmp/.ICE-unix
    4.0K    /tmp/ksocket-root
    4.0K    /tmp/kde-user
    4.0K    /tmp/.X11-unix
    4.0K    /tmp/kde-root
    4.0K    /tmp/plugtmp
    4.0K    /tmp/ssh-GHJiAS2967
    4.0K    /tmp/ksocket-user/artsd-samples
    36K     /tmp/ksocket-user
    8.0K    /tmp/gconfd-user/lock
    12K     /tmp/gconfd-user
    92K     /tmp

    Evidently Linux programs are better behaved. Or their just sticking their 'temporary' files somewhere else. BTW /tmp is not a tmpfs mount.

     

    Holy shit! Your password is hunter2  as well??

    No way!



  • @m0ffx said:

    Evidently Linux programs are better behaved. Or their just sticking their 'temporary' files somewhere else. BTW /tmp is not a tmpfs mount.


    It's even better as tmpfs mounts, to state the obvious. Mind you I haven't found a craplet for nix to pollute my /tmp with megabytes upon megabytes of year old data. Mind you it is not from lack of trying.



  • @Lingerance said:

    @m0ffx said:

    Evidently Linux programs are better behaved. Or their just sticking their 'temporary' files somewhere else. BTW /tmp is not a tmpfs mount.


    It's even better as tmpfs mounts, to state the obvious. Mind you I haven't found a craplet for nix to pollute my /tmp with megabytes upon megabytes of year old data. Mind you it is not from lack of trying.

    /tmp is specifically defined as being for tiny, short-term temporary files, like sockets. Large, long-term cruft goes into /var/tmp, but most craplets just put it in . 



  • over three gigs on my home machine.  This crap is all safe to be deleted, right?



  • @belgariontheking said:

    over three gigs on my home machine.  This crap is all safe to be deleted, right?

    Should be, anything that is open (meaning locked) will not be deleted.

    DEL /S /F /Q %TEMP%\*.*
    

    Although I don't know how to find out how much space everything in a directory and it's subdirectories are taking up. DIR only will list the amount used by the folder it scans (not subdirectories).



  • @Lingerance said:

    @belgariontheking said:
    over three gigs on my home machine.  This crap is all safe to be deleted, right?

    Should be, anything that is open (meaning locked) will not be deleted.

    DEL /S /F /Q %TEMP%\*.*

    Although I don't know how to find out how much space everything in a directory and it's subdirectories are taking up. DIR only will list the amount used by the folder it scans (not subdirectories).

    In explorer, just right click the directory and hit properties... or are we too 1337 for that?

     

     

     



  • @MasterPlanSoftware said:

    @Lingerance said:
    @belgariontheking said:
    over three gigs on my home machine.  This crap is all safe to be deleted, right?

    Should be, anything that is open (meaning locked) will not be deleted.

    DEL /S /F /Q %TEMP%\*.*

    Although I don't know how to find out how much space everything in a directory and it's subdirectories are taking up. DIR only will list the amount used by the folder it scans (not subdirectories).

    In explorer, just right click the directory and hit properties... or are we too 1337 for that?
    That can't be automated. Mind you batch files and shell commands are so bastardized it seems pointless to do so. However my point still stands, it must be automatable.



  • @m0ffx said:

    $ sudo du -h /tmp
    [sudo] password for user:
    4.0K    /tmp/orbit-user
    4.0K    /tmp/.ICE-unix
    4.0K    /tmp/ksocket-root
    4.0K    /tmp/kde-user
    4.0K    /tmp/.X11-unix
    4.0K    /tmp/kde-root
    4.0K    /tmp/plugtmp
    4.0K    /tmp/ssh-GHJiAS2967
    4.0K    /tmp/ksocket-user/artsd-samples
    36K     /tmp/ksocket-user
    8.0K    /tmp/gconfd-user/lock
    12K     /tmp/gconfd-user
    92K     /tmp

    Evidently Linux programs are better behaved. Or their just sticking their 'temporary' files somewhere else. BTW /tmp is not a tmpfs mount.

    Flash Player leaves its junk lying around:

    daniel@daniel-laptop:~$ ls /tmp
    total 30320
    prw------- 1 daniel daniel       0 2007-12-12 11:28 AtiXUEvent000027af_089c6180
    prw------- 1 daniel daniel       0 2007-12-12 11:28 AtiXUEvent000027af_089e3ec8
    prw------- 1 daniel daniel       0 2007-12-12 11:28 AtiXUEvent000027af_08e64ed0
    prw------- 1 daniel daniel       0 2007-12-12 11:28 AtiXUEvent000027af_090c3218
    prw------- 1 daniel daniel       0 2007-12-12 11:28 AtiXUEvent0000296f_089c6180
    prw------- 1 daniel daniel       0 2007-12-12 11:28 AtiXUEvent0000296f_089e3ec8
    prw------- 1 daniel daniel       0 2007-12-12 11:28 AtiXUEvent0000296f_08e6ccb8
    prw------- 1 daniel daniel       0 2007-12-12 11:28 AtiXUEvent0000296f_090b9400
    -rw------- 1 daniel daniel 2705424 2007-12-12 11:50 FlashafaUTm
    -rw------- 1 daniel daniel 2019822 2007-12-12 11:51 FlasheUVuNn
    -rw------- 1 daniel daniel 1856754 2007-12-12 11:48 FlashfdhSFd
    -rw------- 1 daniel daniel 5718776 2007-12-12 11:52 Flashi8Su6e
    -rw------- 1 daniel daniel 5439488 2007-12-12 11:45 FlashlAb1u3
    -rw------- 1 daniel daniel 3625904 2007-12-12 11:51 FlashnXHO1d
    -rw------- 1 daniel daniel 2361078 2007-12-12 11:45 FlashpOHokZ
    -rw------- 1 daniel daniel 1856754 2007-12-12 11:49 FlashppCw8U
    -rw------- 1 daniel daniel 2434884 2007-12-12 11:48 FlashR7R5sd
    -rw------- 1 daniel daniel 2892216 2007-12-12 11:47 FlashrhdvpF
    drwx------ 3 daniel daniel    4096 2007-12-12 11:25 gconfd-daniel
    drwxrwxrwt 3 daniel daniel    4096 2007-12-12 11:25 gdl
    srwxr-xr-x 1 daniel daniel       0 2007-12-12 11:50 gedit.daniel.2350874123
    drwx------ 2 daniel daniel    4096 2007-12-12 11:29 kde-daniel
    drwx------ 2 daniel daniel    4096 2007-12-12 11:25 keyring-sGgJcT
    drwx------ 2 daniel daniel    4096 2007-12-12 14:05 ksocket-daniel
    srwxr-xr-x 1 daniel daniel       0 2007-12-12 11:25 mapping-daniel
    drwx------ 2 daniel daniel    4096 2007-12-12 14:07 orbit-daniel
    srwxr-xr-x 1 daniel daniel       0 2007-12-12 11:26 OSL_PIPE_1000_SingleOfficeIPC_c6492c5fb3a64918f3a904c6ed564d
    drwx------ 2 daniel daniel    4096 2007-12-12 11:25 seahorse-TmSOrE
    -rw------- 1 root   root        29 2007-12-12 11:19 sqlymo4FZ
    drwx------ 2 daniel daniel    4096 2007-12-12 11:25 ssh-jWMRnH6715
    drwxr-xr-x 2 daniel daniel    4096 2007-12-12 11:26 svc86.tmp
    drwx------ 3 daniel daniel    4096 2007-12-12 14:07 Tracker-daniel.6895
    drwx------ 2 daniel daniel    4096 2007-12-12 11:25 virtual-daniel.BQsOI6
    drwxrwxrwt 2 root   root      4096 2007-12-12 11:20 VMwareDnD
    

    My server seems rather clean:

    server2:/tmp# ls -la
    total 1775
    drwxrwxrwt  9 root     root        3072 2007-12-09 06:49 .
    drwxr-xr-x 22 root     root        1024 2007-12-02 23:05 ..
    drwxr-xr-x  2 root     root        1024 2007-11-11 13:23 hsperfdata_root
    drwxrwxrwt  2 root     root        1024 2007-09-13 06:56 .ICE-unix
    drwx------  2 root     root        1024 2007-07-09 23:40 lost+found
    -rw-------  1 root     root           0 2007-10-11 11:49 mkinitramfs-OL_L26042
    -rw-------  1 root     root           0 2007-10-11 11:50 mkinitramfs-OL_V29031
    drwx------  8 root     root        1024 2007-10-11 11:50 mkinitramfs_Q29030
    drwx------  8 root     root        1024 2007-10-11 11:49 mkinitramfs_r26041
    srwxr-xr-x  1 www-data www-data       0 2007-12-09 06:49 php.socket-0
    srwxr-xr-x  1 www-data www-data       0 2007-12-09 06:49 php.socket-1
    drwxr-xr-x  8 daniel   daniel      1024 2007-12-01 01:26 smf
    -rw-r--r--  1 daniel   daniel   1797696 2007-09-26 03:29 smf_1-1-4_install.tar.gz
    drwxrwxrwt  2 root     root        1024 2007-09-13 06:56 .X11-unix
    

    Plesk seems to leave junk lying around, from my Plesk server (although I guess this isn't that bad, they're upgrade logs. Although I guess something important like this should really be in a different directory):

    web1:/tmp# ls -lah
    total 536K
    drwxrwxrwt  3 root     root     2.1K 2007-12-12 10:26 .
    drwxr-xr-x 21 root     root     4.0K 2007-07-11 13:30 ..
    -rw-------  1 root     root      442 2007-11-10 15:59 api-rpc_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      470 2007-11-10 15:59 api-rpc_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      225 2007-11-10 15:59 api-rpc_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      441 2007-11-10 15:59 api-rpc_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root     102K 2007-11-10 16:00 autoinstaller3.log
    -rw-------  1 root     root      251 2007-11-10 15:59 awstats-configurator_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      265 2007-11-10 15:59 awstats-configurator_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      470 2007-11-10 15:58 backup-manager_8.2.0_debian4.0.build82070706.15_problems.071110.15.58.log
    -rw-------  1 root     root      698 2007-11-10 15:58 backup-manager_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.58.log
    -rw-------  1 root     root      235 2007-11-10 15:58 backup-manager_8.2.1_debian4.0.build82070918.10_problems.071110.15.58.log
    -rw-------  1 root     root      239 2007-11-10 15:59 backup-manager_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      249 2007-11-10 15:58 backup-manager_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.58.log
    -rw-------  1 root     root      508 2007-11-10 15:59 backup-manager_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      231 2007-11-10 15:59 courier-imap_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      245 2007-11-10 15:59 courier-imap_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      231 2007-11-10 15:59 courier-imap_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      235 2007-11-10 16:00 courier-imap_8.2.1_debian4.0.build82070918.10_problems.071110.16.00.log
    -rw-------  1 root     root      245 2007-11-10 15:59 courier-imap_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      249 2007-11-10 16:00 courier-imap_8.2.1_debian4.0.build82070918.10_upgrade.071110.16.00.log
    -rw-------  1 root     root      239 2007-11-10 15:59 courier-imap-add_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      253 2007-11-10 15:59 courier-imap-add_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      243 2007-11-10 16:00 courier-imap-add_8.2.1_debian4.0.build82070918.10_problems.071110.16.00.log
    -rw-------  1 root     root      478 2007-11-10 16:00 courier-imap-add_8.2.1_debian4.0.build82070918.10_upgrade.071110.16.00.log
    -rw-------  1 root     root      391 2007-11-10 16:00 cs-gs_2.0.0_Debian_4.0_build82070918.10_psa_problems.log
    -rw-------  1 root     root      491 2007-11-10 16:00 cs-gs_2.0.0_Debian_4.0_build82070918.10_upgrade.log
    -rw-------  1 root     root      434 2007-11-10 15:59 cs-gs_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      462 2007-11-10 15:59 cs-gs_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      109 2007-11-10 15:59 cs-gs_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      111 2007-11-10 16:00 cs-gs_8.2.1_debian4.0.build82070918.10_problems.071110.16.00.log
    -rw-------  1 root     root      220 2007-11-10 15:59 cs-gs_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      222 2007-11-10 16:00 cs-gs_8.2.1_debian4.0.build82070918.10_upgrade.071110.16.00.log
    -rw-r--r--  1 www-data www-data    5 2007-12-04 15:28 dos-127.0.0.1
    -rw-r--r--  1 www-data www-data    5 2007-12-04 16:26 dos-140.159.2.31
    -rw-r--r--  1 www-data www-data    6 2007-12-04 17:35 dos-210.49.199.87
    -rw-r--r--  1 www-data www-data    6 2007-12-04 17:36 dos-210.84.43.182
    -rw-r--r--  1 www-data www-data    5 2007-12-04 15:28 dos-211.27.114.135
    -rw-r--r--  1 www-data www-data    6 2007-12-04 17:49 dos-211.27.65.132
    -rw-r--r--  1 www-data www-data    6 2007-12-04 18:07 dos-211.28.42.96
    -rw-r--r--  1 www-data www-data    6 2007-12-04 17:59 dos-220.253.62.106
    -rw-r--r--  1 www-data www-data    6 2007-12-04 17:23 dos-58.104.70.39
    -rw-r--r--  1 www-data www-data    5 2007-12-04 16:20 dos-58.107.221.226
    -rw-r--r--  1 www-data www-data    6 2007-12-04 17:44 dos-58.175.243.43
    -rw-r--r--  1 www-data www-data    6 2007-12-04 17:36 dos-59.167.65.174
    -rw-r--r--  1 www-data www-data    6 2007-12-04 17:12 dos-59.167.87.107
    -rw-------  1 root     root      223 2007-11-10 15:59 firewall_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      237 2007-11-10 15:59 firewall_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      223 2007-11-10 15:59 firewall_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      227 2007-11-10 16:00 firewall_8.2.1_debian4.0.build82070918.10_problems.071110.16.00.log
    -rw-------  1 root     root      399 2007-11-10 15:59 firewall_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      555 2007-11-10 16:00 firewall_8.2.1_debian4.0.build82070918.10_upgrade.071110.16.00.log
    -rw-------  1 root     root      217 2007-11-10 15:59 horde_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      231 2007-11-10 15:59 horde_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      217 2007-11-10 15:59 horde_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      221 2007-11-10 16:00 horde_8.2.1_debian4.0.build82070918.10_problems.071110.16.00.log
    -rw-------  1 root     root      231 2007-11-10 15:59 horde_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      887 2007-11-10 16:00 horde_8.2.1_debian4.0.build82070918.10_upgrade.071110.16.00.log
    -rw-------  1 root     root      426 2007-11-10 15:59 imp_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      454 2007-11-10 15:59 imp_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      213 2007-11-10 15:59 imp_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      217 2007-11-10 16:00 imp_8.2.1_debian4.0.build82070918.10_problems.071110.16.00.log
    -rw-------  1 root     root      227 2007-11-10 15:59 imp_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      328 2007-11-10 16:00 imp_8.2.1_debian4.0.build82070918.10_upgrade.071110.16.00.log
    -rw-------  1 root     root      231 2007-11-10 15:59 libpam-plesk_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      245 2007-11-10 15:59 libpam-plesk_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root     1.5K 2007-11-10 15:59 libpam-plesk_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      733 2007-11-10 15:59 libpam-plesk_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      221 2007-11-10 15:59 log4cpp_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      235 2007-11-10 15:59 log4cpp_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      225 2007-11-10 15:59 log4cpp_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      239 2007-11-10 15:59 log4cpp_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      219 2007-11-10 15:59 miva_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      554 2007-11-10 15:59 miva_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rwx------  1 root     root     4.1K 2007-11-10 16:00 monitrc.chk
    drwxr-xr-x  3 root     root       60 2007-09-22 01:04 pear
    -rw-------  1 root     root      426 2007-11-10 15:59 pmm_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      654 2007-11-10 15:59 pmm_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      217 2007-11-10 15:59 pmm_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      486 2007-11-10 15:59 pmm_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      446 2007-11-10 15:59 proftpd_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      678 2007-11-10 15:59 proftpd_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      470 2007-11-10 16:00 proftpd-inetd_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      498 2007-11-10 16:00 proftpd-inetd_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      426 2007-11-10 15:58 psa_8.2.0_debian4.0.build82070706.15_problems.071110.15.58.log
    -rw-------  1 root     root      454 2007-11-10 15:58 psa_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.58.log
    -rw-------  1 root     root      430 2007-11-10 15:59 psa_8.2.1_debian4.0.build82070918.10_problems.071110.15.58.log
    -rw-------  1 root     root      13K 2007-11-10 15:59 psa_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.58.log
    -rw-------  1 root     root        0 2007-11-10 15:53 psa-installer.lock
    -rw-------  1 root     root      434 2007-11-10 15:59 qmail_8.2.0_debian4.0.build82070807.17_problems.071110.15.59.log
    -rw-------  1 root     root      462 2007-11-10 15:59 qmail_8.2.0_debian4.0.build82070807.17_upgrade.071110.15.59.log
    -rw-------  1 root     root      217 2007-11-10 15:59 qmail_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      221 2007-11-10 16:00 qmail_8.2.1_debian4.0.build82070918.10_problems.071110.16.00.log
    -rw-------  1 root     root     1.1K 2007-11-10 15:59 qmail_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      646 2007-11-10 16:00 qmail_8.2.1_debian4.0.build82070918.10_upgrade.071110.16.00.log
    -rw-------  1 root     root      251 2007-11-10 15:58 rubyrails-configurator_8.2.0_debian4.0.build82070706.15_problems.071110.15.58.log
    -rw-------  1 root     root      265 2007-11-10 15:58 rubyrails-configurator_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.58.log
    -rw-------  1 root     root      255 2007-11-10 15:59 rubyrails-configurator_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      269 2007-11-10 15:59 rubyrails-configurator_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root       29 2007-09-13 06:56 sqlBfPZpi
    -rw-------  1 root     root      223 2007-11-10 15:59 watchdog_8.2.0_debian4.0.build82070706.15_problems.071110.15.59.log
    -rw-------  1 root     root      237 2007-11-10 15:59 watchdog_8.2.0_debian4.0.build82070706.15_upgrade.071110.15.59.log
    -rw-------  1 root     root      223 2007-11-10 15:59 watchdog_8.2.1_debian4.0.build82070918.10_problems.071110.15.59.log
    -rw-------  1 root     root      227 2007-11-10 16:00 watchdog_8.2.1_debian4.0.build82070918.10_problems.071110.16.00.log
    -rw-------  1 root     root      400 2007-11-10 15:59 watchdog_8.2.1_debian4.0.build82070918.10_upgrade.071110.15.59.log
    -rw-------  1 root     root      467 2007-11-10 16:00 watchdog_8.2.1_debian4.0.build82070918.10_upgrade.071110.16.00.log
    


  • @m0ffx said:

    Evidently Linux programs are better behaved. Or their just sticking their 'temporary' files somewhere else. BTW /tmp is not a tmpfs mount.

    Well, /tmp should be cleaned after every system boot. Additionally, there might be a cron job that deletes those files.

    But still, Unix programmers appear to be more disciplined when it comes to cleaning up files. 



  • @asuffield said:

    @Lingerance said:
    @m0ffx said:

    Evidently Linux programs are better behaved. Or their just sticking their 'temporary' files somewhere else. BTW /tmp is not a tmpfs mount.


    It's even better as tmpfs mounts, to state the obvious. Mind you I haven't found a craplet for nix to pollute my /tmp with megabytes upon megabytes of year old data. Mind you it is not from lack of trying.

    /tmp is specifically defined as being for tiny, short-term temporary files, like sockets. Large, long-term cruft goes into /var/tmp, but most craplets just put it in . 

    Point, /var/tmp is 17 megs.



  • @Lingerance said:

    @MasterPlanSoftware said:
    @Lingerance said:
    @belgariontheking said:
    over three gigs on my home machine.  This crap is all safe to be deleted, right?

    Should be, anything that is open (meaning locked) will not be deleted.

    DEL /S /F /Q %TEMP%\*.*

    Although I don't know how to find out how much space everything in a directory and it's subdirectories are taking up. DIR only will list the amount used by the folder it scans (not subdirectories).

    In explorer, just right click the directory and hit properties... or are we too 1337 for that?
    That can't be automated. Mind you batch files and shell commands are so bastardized it seems pointless to do so. However my point still stands, it must be automatable.

    DIR /S /A %TEMP% is about as automated as it comes:

    Total Files Listed:
                293 File(s)     66.571.474 bytes
                164 Dir(s)  17.678.057.472 bytes free



  • @Lingerance said:

    @belgariontheking said:
    over three gigs on my home machine.  This crap is all safe to be deleted, right?

    Should be, anything that is open (meaning locked) will not be deleted.

    DEL /S /F /Q %TEMP%\*.*

    Although I don't know how to find out how much space everything in a directory and it's subdirectories are taking up. DIR only will list the amount used by the folder it scans (not subdirectories).

    You might want to make that:

    IF EXIST %TEMP% DEL /S /F /Q %TEMP%*.*

    on the off chance that some other app in the current environment did something stoopid like "set temp="



  • @Grimoire said:

    @Lingerance said:
    @belgariontheking said:
    over three gigs on my home machine.  This crap is all safe to be deleted, right?
    Should be, anything that is open (meaning locked) will not be deleted.
    DEL /S /F /Q %TEMP%*.*

    Although I don't know how to find out how much space everything in a directory _and_ it's subdirectories are taking up. DIR only will list the amount used by the folder it scans (not subdirectories).

    You might want to make that:

    IF EXIST %TEMP% DEL /S /F /Q %TEMP%\*.*

    on the off chance that some other app in the current environment did something stoopid like "set temp="

    Just do a: 

    set temp=C:\Windows

    or

    set temp=%windir%

    and wait for someone to do a DEL /S /F /Q %TEMP%\*.*

    Hilarity ensues!



  • @Lingerance said:

    @belgariontheking said:
    over three gigs on my home machine.  This crap is all safe to be deleted, right?

    Should be, anything that is open (meaning locked) will not be deleted.

    DEL /S /F /Q %TEMP%\*.*

    Although I don't know how to find out how much space everything in a directory and it's subdirectories are taking up. DIR only will list the amount used by the folder it scans (not subdirectories).

    Just did this, and apparently WinRAR is a huge culprit of not cleaning up their files.  I use WinRAR for everything from zip to rar to bzip, and haven't reformatted my hard drive in two years, I had a good chunk of WinRAR garbage in my temp. 



  • A certain DOS-based browser did that for a few versions (deleted files in %TEMP%) until a non-technical person ran it using a default install of MS-DOS 6.22 (IIRC). That sets TEMP=C:\DOS. Of course most people would change that to something sane like C:\TEMP.


Log in to reply