bug-gnustep
[Top][All Lists]
Advanced

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

[bugs #7532] [NSFileManager -fileExistsAtPath:isDirectory] behaves diffe


From: Richard Frith-Macdonald
Subject: [bugs #7532] [NSFileManager -fileExistsAtPath:isDirectory] behaves differently from Apple's.
Date: Wed, 31 Mar 2004 08:57:27 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312 Debian/1.6-3

This mail is an automated notification from the bugs tracker
 of the project: GNUstep.

/**************************************************************************/
[bugs #7532] Latest Modifications:

Changes by: 
                Richard Frith-Macdonald <rfm@gnu.org>
'Date: 
                Wed 03/31/04 at 13:57 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
Fixed in CVS ... thanks.






/**************************************************************************/
[bugs #7532] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=7532>
Project: GNUstep
Submitted by: Kazunobu Kuriyama
On: Sat 01/31/04 at 20:23

Category:  Base/Foundation
Severity:  1 - None
Item Group:  Bug
Resolution:  Fixed
Assigned to:  None
Status:  Closed


Summary:  [NSFileManager -fileExistsAtPath:isDirectory] behaves differently 
from Apple's.

Original Submission:  In the specification, values returned through a pointer 
passed to isDirectory are not specified when a given path doesn't exist.  
Nonetheless, the Apple's implementation returns the boolean NO if a given path 
doesn't exist.

Therefore, the following code works file for Mac,
but not for GNUstep:

NSFileManager *fm = [NSFileManager defaultManager];
NSString *path;
BOOL isDir;

(path is assumed to be set somewhere.)

[fm fileExistsAtPath: path isDirectory: &isDir];
if (isDir) {
    (some operations if path is a directory)
}

Actually, on my machine (i686-pc-linux-gnu), we got
isDir = 8 when 'path' is not an existing path, thereby it is regarded as a 
directory.

It is possible for us not to call it a GNUstep's bug because the behavior of 
the method of the Apple's version is not specified by the spec. Also, the code 
above itself is bad because it doesn't check the return value of the method.

Having said so, it would be reasonable to set 'isDir' to NO when 'path' is not 
an existing path.

Follow-up Comments
------------------


-------------------------------------------------------
Date: Wed 03/31/04 at 13:57         By: CaS
Fixed in CVS ... thanks.




CC List
-------

CC Address                          | Comment
------------------------------------+-----------------------------
kazu                                | 









For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=7532>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

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