octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

isir should return a logical value


From: John W. Eaton
Subject: isir should return a logical value
Date: Tue, 04 Sep 2007 14:15:20 -0400

On  3-Sep-2007, David Bateman wrote:

| The function isdir should return a logical value.. Trivial patch attached..

|   function t = isdir (x)
|     if (nargin == 1)
| !     t = exist (x, "dir");
|     else
|       print_usage ("isdir");
|     endif
| --- 24,30 ----
|   
|   function t = isdir (x)
|     if (nargin == 1)
| !     t = exist (x, "dir") > 0;
|     else
|       print_usage ("isdir");
|     endif

I fixed this problem but used "== 7" instead of "> 0" since exist is
defined to return 7 for directories.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]