mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 08:26:27 +00:00
need windows.h before winsock2.h
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38922 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fd21cb27aa
commit
a6958f4c06
2 changed files with 22 additions and 6 deletions
|
@ -22,6 +22,7 @@
|
|||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
#include "common.h"
|
||||
|
|
|
@ -15,6 +15,7 @@ int main()
|
|||
NSDictionary *attr;
|
||||
NSString *dirInDir;
|
||||
NSString *str1,*str2;
|
||||
NSString *tmp;
|
||||
NSError *err;
|
||||
NSDictionary *errInfo;
|
||||
BOOL exists;
|
||||
|
@ -174,8 +175,10 @@ NSLog(@"'%@', '%@'", NSUserName(), [attr fileOwnerAccountName]);
|
|||
attributes: nil];
|
||||
PASS(NO == [mgr contentsEqualAtPath: @"sub1/x" andPath: @"sub2/x"],
|
||||
"directories containing files with different content are not equal");
|
||||
[mgr removeFileAtPath: @"sub1" handler: nil];
|
||||
[mgr removeFileAtPath: @"sub2" handler: nil];
|
||||
PASS(YES == [mgr removeFileAtPath: @"sub1" handler: nil],
|
||||
"sub1 removed");
|
||||
PASS(YES == [mgr removeFileAtPath: @"sub2" handler: nil],
|
||||
"sub2 removed");
|
||||
|
||||
err = nil;
|
||||
PASS([mgr createDirectoryAtPath: dirInDir
|
||||
|
@ -198,13 +201,25 @@ NSLog(@"'%@', '%@'", NSUserName(), [attr fileOwnerAccountName]);
|
|||
PASS([mgr fileExistsAtPath: dirInDir isDirectory: &isDir] && isDir == YES,
|
||||
"NSFileManager create directory and intermediate directory");
|
||||
|
||||
[mgr changeCurrentDirectoryPath: [[[mgr currentDirectoryPath] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]];
|
||||
tmp = [mgr currentDirectoryPath];
|
||||
exists = [mgr fileExistsAtPath: tmp isDirectory: &isDir];
|
||||
PASS(YES == exists && YES == isDir, "current directory exists");
|
||||
tmp = [tmp stringByDeletingLastPathComponent];
|
||||
exists = [mgr fileExistsAtPath: tmp isDirectory: &isDir];
|
||||
PASS(YES == exists && YES == isDir, "parent directory exists");
|
||||
tmp = [tmp stringByDeletingLastPathComponent];
|
||||
exists = [mgr fileExistsAtPath: tmp isDirectory: &isDir];
|
||||
PASS(YES == exists && YES == isDir, "parent of parent directory exists");
|
||||
[mgr changeCurrentDirectoryPath: tmp];
|
||||
exists = [mgr fileExistsAtPath: dir isDirectory: &isDir];
|
||||
PASS(YES == exists && YES == isDir, "directory exists");
|
||||
if (exists && isDir)
|
||||
{
|
||||
PASS([mgr removeFileAtPath: dir handler: nil],
|
||||
"NSFileManager removes a directory");
|
||||
PASS(![mgr fileExistsAtPath: dir],"directory no longer exists");
|
||||
dir - [dir stringByStandardizingPath];
|
||||
PASS([mgr removeFileAtPath: dir handler: nil], "removed directory");
|
||||
PASS(![mgr fileExistsAtPath: dir], "directory no longer exists");
|
||||
GSPrintf(stdout, @"%@\n", dir);
|
||||
GSPrintf(stderr, @"%@\n", dir);
|
||||
}
|
||||
|
||||
err = nil;
|
||||
|
|
Loading…
Reference in a new issue