diff scripts/miscellaneous/tempdir.m @ 11626:09f833d41f68 release-3-0-x

[3-0-0-branch @ 2008-01-30 07:57:48 by jwe]
author jwe
date Wed, 30 Jan 2008 07:57:49 +0000
parents a1dbe9d80eee
children 3422f39573b1 1b9fc670dce0
line wrap: on
line diff
--- a/scripts/miscellaneous/tempdir.m
+++ b/scripts/miscellaneous/tempdir.m
@@ -24,8 +24,16 @@
 function dirname = tempdir ()
 
   dirname = getenv ("TMPDIR");
-  if (length (dirname) == 0)
+  if (isempty (dirname))
     dirname = P_tmpdir;
   endif
 
+  if (! strcmp (dirname(end), filesep))
+    strcat (dirname, filesep);
+  endif
+
+  if (! isdir (dirname))
+    warning ("tempdir: `%s' does not exist or is not a directory", dirname);
+  endif
+
 endfunction