home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / Foundation.framework / Versions / B / Headers / NSFileHandle.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-14  |  2.8 KB  |  109 lines

  1. /*    NSFileHandle.h
  2.     Basic operations on open files and communication channels
  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/NSArray.h>
  10. #import <Foundation/NSRange.h>
  11.  
  12. @class NSString, NSData;
  13.  
  14. @interface NSFileHandle : NSObject
  15.  
  16. - (NSData *)availableData;
  17.  
  18. - (NSData *)readDataToEndOfFile;
  19. - (NSData *)readDataOfLength:(unsigned int)length;
  20.  
  21. - (void)writeData:(NSData *)data;
  22.  
  23. - (unsigned long long)offsetInFile;
  24. - (unsigned long long)seekToEndOfFile;
  25. - (void)seekToFileOffset:(unsigned long long)offset;
  26.  
  27. - (void)truncateFileAtOffset:(unsigned long long)offset;
  28. - (void)synchronizeFile;
  29. - (void)closeFile;
  30.  
  31. @end
  32.  
  33. @interface NSFileHandle (NSFileHandleCreation)
  34.  
  35. + (id)fileHandleWithStandardInput;
  36. + (id)fileHandleWithStandardOutput;
  37. + (id)fileHandleWithStandardError;
  38.  
  39. #if !defined(STRICT_40)
  40. + (id)fileHandleWithNullDevice;
  41. #endif
  42.  
  43. + (id)fileHandleForReadingAtPath:(NSString *)path;
  44. + (id)fileHandleForWritingAtPath:(NSString *)path;
  45. + (id)fileHandleForUpdatingAtPath:(NSString *)path;
  46.  
  47. @end
  48.  
  49. FOUNDATION_EXPORT NSString *NSFileHandleOperationException;
  50.  
  51. FOUNDATION_EXPORT NSString *NSFileHandleReadCompletionNotification;
  52. FOUNDATION_EXPORT NSString *NSFileHandleReadToEndOfFileCompletionNotification;
  53. FOUNDATION_EXPORT NSString *NSFileHandleConnectionAcceptedNotification;
  54. #if !defined(STRICT_41) && !defined(STRICT_40)
  55. FOUNDATION_EXPORT NSString *NSFileHandleDataAvailableNotification;
  56. #endif
  57.  
  58. FOUNDATION_EXPORT NSString *NSFileHandleNotificationDataItem;
  59. FOUNDATION_EXPORT NSString *NSFileHandleNotificationFileHandleItem;
  60. FOUNDATION_EXPORT NSString *NSFileHandleNotificationMonitorModes;
  61.  
  62. @interface NSFileHandle (NSFileHandleAsynchronousAccess)
  63.  
  64. - (void)readInBackgroundAndNotifyForModes:(NSArray *)modes;
  65. - (void)readInBackgroundAndNotify;
  66.  
  67. - (void)readToEndOfFileInBackgroundAndNotifyForModes:(NSArray *)modes;
  68. - (void)readToEndOfFileInBackgroundAndNotify;
  69.  
  70. - (void)acceptConnectionInBackgroundAndNotifyForModes:(NSArray *)modes;
  71. - (void)acceptConnectionInBackgroundAndNotify;
  72.  
  73. #if !defined(STRICT_41) && !defined(STRICT_40)
  74. - (void)waitForDataInBackgroundAndNotifyForModes:(NSArray *)modes;
  75. - (void)waitForDataInBackgroundAndNotify;
  76. #endif
  77.  
  78. @end
  79.  
  80. @interface NSFileHandle (NSFileHandlePlatformSpecific)
  81.  
  82. #if defined(WIN32)
  83. #if !defined(STRICT_40)
  84. - (id)initWithNativeHandle:(void *)nativeHandle closeOnDealloc:(BOOL)closeopt;
  85. #endif
  86. - (id)initWithNativeHandle:(void *)nativeHandle;
  87. - (void *)nativeHandle;
  88. #endif
  89.  
  90. #if !defined(STRICT_40)
  91. - (id)initWithFileDescriptor:(int)fd closeOnDealloc:(BOOL)closeopt;
  92. #endif
  93. - (id)initWithFileDescriptor:(int)fd;
  94. - (int)fileDescriptor;
  95.  
  96. @end
  97.  
  98. @interface NSPipe : NSObject
  99.  
  100. - (NSFileHandle *)fileHandleForReading;
  101. - (NSFileHandle *)fileHandleForWriting;
  102.  
  103. - (id)init;
  104. + (id)pipe;
  105.  
  106. @end
  107.  
  108. #endif /* !STRICT_OPENSTEP */
  109.