00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <sys/types.h>
00018
00019 #import "OFSeekableStream.h"
00020
00021 @class OFString;
00022 @class OFArray;
00023 @class OFDate;
00024
00028 @interface OFFile: OFSeekableStream
00029 {
00030 int fd;
00031 BOOL closable;
00032 BOOL eos;
00033 }
00034
00040 + fileWithPath: (OFString*)path
00041 mode: (OFString*)mode;
00042
00048 + fileWithFileDescriptor: (int)fd;
00049
00054 + (OFArray*)componentsOfPath: (OFString*)path;
00055
00060 + (OFString*)lastComponentOfPath: (OFString*)path;
00061
00066 + (OFString*)directoryNameOfPath: (OFString*)path;
00067
00072 + (BOOL)fileExistsAtPath: (OFString*)path;
00073
00078 + (BOOL)directoryExistsAtPath: (OFString*)path;
00079
00085 + (void)createDirectoryAtPath: (OFString*)path;
00086
00091 + (OFArray*)filesInDirectoryAtPath: (OFString*)path;
00092
00098 + (void)changeToDirectory: (OFString*)path;
00099
00103 + (OFDate*)modificationDateOfFile: (OFString*)path;
00104
00114 + (void)changeModeOfFile: (OFString*)path
00115 toMode: (mode_t)mode;
00116
00117 #ifndef _WIN32
00118
00128 + (void)changeOwnerOfFile: (OFString*)path
00129 toOwner: (OFString*)owner
00130 group: (OFString*)group;
00131 #endif
00132
00139 + (void)copyFileAtPath: (OFString*)from
00140 toPath: (OFString*)to;
00141
00148 + (void)renameFileAtPath: (OFString*)from
00149 toPath: (OFString*)to;
00150
00156 + (void)deleteFileAtPath: (OFString*)path;
00157
00163 + (void)deleteDirectoryAtPath: (OFString*)path;
00164
00165 #ifndef _WIN32
00166
00174 + (void)linkFileAtPath: (OFString*)src
00175 toPath: (OFString*)dest;
00176
00185 + (void)symlinkFileAtPath: (OFString*)src
00186 toPath: (OFString*)dest;
00187 #endif
00188
00196 - initWithPath: (OFString*)path
00197 mode: (OFString*)mode;
00198
00205 - initWithFileDescriptor: (int)fd;
00206 @end
00207
00208 extern OFFile *of_stdin;
00209 extern OFFile *of_stdout;
00210 extern OFFile *of_stderr;