home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / NSFileManager.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-11  |  3.8 KB  |  111 lines

  1. /*    NSFileManager.h
  2.     File operations
  3.     Copyright 1994-1996, NeXT Software, Inc.  All rights reserved.
  4. */
  5.  
  6. #if !defined(STRICT_OPENSTEP)
  7.  
  8. #import <Foundation/NSObject.h>
  9. #import <Foundation/NSUtilities.h>
  10.  
  11. @class NSString, NSDate, NSDirectoryEnumerator, NSDictionary, NSArray, NSData;
  12.  
  13. @interface NSFileManager : NSObject
  14.  
  15. + (NSFileManager *)defaultManager;
  16.  
  17. - (NSString *)currentDirectoryPath;
  18. - (BOOL)changeCurrentDirectoryPath:(NSString *)path;
  19.  
  20. - (NSDictionary *)fileAttributesAtPath:(NSString *)path traverseLink:(BOOL)yorn;
  21.  
  22. - (BOOL)changeFileAttributes:(NSDictionary *)attributes atPath:(NSString *)path;
  23.  
  24. - (BOOL)fileExistsAtPath:(NSString *)path;
  25. - (BOOL)fileExistsAtPath:(NSString *)path isDirectory:(BOOL *)isDirectory;
  26. - (BOOL)isReadableFileAtPath:(NSString *)path;
  27. - (BOOL)isWritableFileAtPath:(NSString *)path;
  28. - (BOOL)isExecutableFileAtPath:(NSString *)path;
  29. - (BOOL)isDeletableFileAtPath:(NSString *)path;
  30.  
  31. - (BOOL)contentsEqualAtPath:(NSString *)path1 andPath:(NSString *)path2;
  32. - (BOOL)linkPath:(NSString *)src toPath:(NSString *)dest handler:handler;
  33. - (BOOL)copyPath:(NSString *)src toPath:(NSString *)dest handler:handler;
  34.  
  35. - (BOOL)movePath:(NSString *)src toPath:(NSString *)dest handler:handler;    
  36.  
  37. - (BOOL)removeFileAtPath:(NSString *)path handler:handler;
  38.  
  39. - (NSArray *)directoryContentsAtPath:(NSString *)path;
  40. - (NSDirectoryEnumerator *)enumeratorAtPath:(NSString *)path;
  41. - (NSArray *)subpathsAtPath:(NSString *)path;
  42.  
  43. - (BOOL)createDirectoryAtPath:(NSString *)path attributes:(NSDictionary *)attributes;
  44.  
  45. - (NSData *)contentsAtPath:(NSString *)path;
  46. - (BOOL)createFileAtPath:(NSString *)path contents:(NSData *)data attributes:(NSDictionary *)attr;
  47.  
  48. - (NSString *)pathContentOfSymbolicLinkAtPath:(NSString *)path;
  49. - (BOOL)createSymbolicLinkAtPath:(NSString *)path pathContent:(NSString *)otherpath;
  50.  
  51. - (NSDictionary *)fileSystemAttributesAtPath:(NSString *)path;
  52.  
  53. - (const char *)fileSystemRepresentationWithPath:(NSString *)path;
  54. - (NSString *)stringWithFileSystemRepresentation:(const char *)str length:(unsigned)len;
  55.  
  56. @end
  57.  
  58. @interface NSObject (NSCopyLinkMoveHandler)
  59. - (BOOL)fileManager:(NSFileManager *)fm shouldProceedAfterError:(NSDictionary *)errorInfo;
  60. - (void)fileManager:(NSFileManager *)fm willProcessPath:(NSString *)path;
  61. @end
  62.  
  63. @interface NSDirectoryEnumerator : NSEnumerator
  64. - (NSDictionary *)fileAttributes;
  65. - (NSDictionary *)directoryAttributes;
  66. - (void)skipDescendents;
  67. @end
  68.  
  69. /**************** File Attributes ****************/
  70.  
  71. FOUNDATION_EXPORT NSString *NSFileType;
  72. FOUNDATION_EXPORT NSString     *NSFileTypeDirectory;
  73. FOUNDATION_EXPORT NSString     *NSFileTypeRegular;
  74. FOUNDATION_EXPORT NSString     *NSFileTypeSymbolicLink;
  75. FOUNDATION_EXPORT NSString     *NSFileTypeSocket;
  76. FOUNDATION_EXPORT NSString     *NSFileTypeCharacterSpecial;
  77. FOUNDATION_EXPORT NSString     *NSFileTypeBlockSpecial;
  78. FOUNDATION_EXPORT NSString     *NSFileTypeUnknown;
  79. FOUNDATION_EXPORT NSString    *NSFileSize;
  80. FOUNDATION_EXPORT NSString *NSFileModificationDate;
  81. FOUNDATION_EXPORT NSString *NSFileReferenceCount;
  82. FOUNDATION_EXPORT NSString *NSFileDeviceIdentifier;
  83. FOUNDATION_EXPORT NSString *NSFileOwnerAccountName;
  84. FOUNDATION_EXPORT NSString *NSFileGroupOwnerAccountName;
  85. FOUNDATION_EXPORT NSString *NSFilePosixPermissions;
  86. FOUNDATION_EXPORT NSString *NSFileSystemNumber;
  87. FOUNDATION_EXPORT NSString *NSFileSystemFileNumber;
  88.  
  89. /* File System attributes */
  90. FOUNDATION_EXPORT NSString *NSFileSystemSize;
  91. FOUNDATION_EXPORT NSString *NSFileSystemFreeSize;
  92. FOUNDATION_EXPORT NSString *NSFileSystemNodes;
  93. FOUNDATION_EXPORT NSString *NSFileSystemFreeNodes;
  94.  
  95. @interface NSDictionary (NSFileAttributes)
  96.  
  97. - (unsigned long long)fileSize;
  98. - (NSDate *)fileModificationDate;
  99. - (NSString *)fileType;
  100. - (unsigned long)filePosixPermissions;
  101. - (NSString *)fileOwnerAccountName;
  102. - (NSString *)fileGroupOwnerAccountName;
  103. #ifndef WIN32
  104. - (unsigned long)fileSystemNumber;
  105. - (unsigned long)fileSystemFileNumber;
  106. #endif
  107.  
  108. @end
  109.  
  110. #endif /* !STRICT_OPENSTEP */
  111.