comparison scripts/miscellaneous/bzip2.m @ 15701:edce7d75597b

Change .m files to use tempdir instead of P_tmpdir (patch #7875) * scripts/help/__makeinfo__.m, scripts/miscellaneous/bzip2.m: Switching away from using P_tmpdir directly, to using tempdir. This allows the usage of TMPDIR to specify the temporary directory as is done in most other places.
author Corbin Champion <corbinlc@gmail.com>
date Thu, 25 Oct 2012 14:06:35 -0700
parents 86854d032a37
children bc924baa2c4e
comparison
equal deleted inserted replaced
15700:5d6a5bc65ef1 15701:edce7d75597b
47 %! # test for correct cleanup of temporary files 47 %! # test for correct cleanup of temporary files
48 %! unwind_protect 48 %! unwind_protect
49 %! filename = tmpnam; 49 %! filename = tmpnam;
50 %! dummy = 1; 50 %! dummy = 1;
51 %! save (filename, "dummy"); 51 %! save (filename, "dummy");
52 %! n_tmpfiles_before = length (find (strncmp ("oct-", cellstr (ls (P_tmpdir)), 4))); 52 %! n_tmpfiles_before = length (find (strncmp ("oct-", cellstr (ls (tempdir)), 4)));
53 %! entry = bzip2 (filename); 53 %! entry = bzip2 (filename);
54 %! n_tmpfiles_after = length (find (strncmp ("oct-", cellstr (ls (P_tmpdir)), 4))); 54 %! n_tmpfiles_after = length (find (strncmp ("oct-", cellstr (ls (tempdir)), 4)));
55 %! if (n_tmpfiles_before != n_tmpfiles_after) 55 %! if (n_tmpfiles_before != n_tmpfiles_after)
56 %! error ("bzip2 has not cleaned up temporary files correctly!"); 56 %! error ("bzip2 has not cleaned up temporary files correctly!");
57 %! endif 57 %! endif
58 %! unwind_protect_cleanup 58 %! unwind_protect_cleanup
59 %! delete (filename); 59 %! delete (filename);