00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <sys/types.h>
00013
00014 #import "OFSeekableStream.h"
00015
00016 @class OFString;
00017 @class OFArray;
00018
00022 @interface OFFile: OFSeekableStream
00023 {
00024 int fd;
00025 BOOL closable;
00026 BOOL eos;
00027 }
00028
00034 + fileWithPath: (OFString*)path
00035 mode: (OFString*)mode;
00036
00042 + fileWithFileDescriptor: (int)fd;
00043
00048 + (OFString*)lastComponentOfPath: (OFString*)path;
00049
00054 + (BOOL)fileExistsAtPath: (OFString*)path;
00055
00060 + (BOOL)directoryExistsAtPath: (OFString*)path;
00061
00067 + (void)createDirectoryAtPath: (OFString*)path;
00068
00073 + (OFArray*)filesInDirectoryAtPath: (OFString*)path;
00074
00084 + (void)changeModeOfFile: (OFString*)path
00085 toMode: (mode_t)mode;
00086
00087 #ifndef _WIN32
00088
00098 + (void)changeOwnerOfFile: (OFString*)path
00099 toOwner: (uid_t)owner
00100 group: (gid_t)group;
00101 #endif
00102
00109 + (void)copyFileAtPath: (OFString*)from
00110 toPath: (OFString*)to;
00111
00118 + (void)renameFileAtPath: (OFString*)from
00119 toPath: (OFString*)to;
00120
00126 + (void)deleteFileAtPath: (OFString*)path;
00127
00133 + (void)deleteDirectoryAtPath: (OFString*)path;
00134
00135 #ifndef _WIN32
00136
00144 + (void)linkFileAtPath: (OFString*)src
00145 toPath: (OFString*)dest;
00146
00155 + (void)symlinkFileAtPath: (OFString*)src
00156 toPath: (OFString*)dest;
00157 #endif
00158
00166 - initWithPath: (OFString*)path
00167 mode: (OFString*)mode;
00168
00175 - initWithFileDescriptor: (int)fd;
00176 @end
00177
00179 extern OFFile *of_stdin;
00181 extern OFFile *of_stdout;
00183 extern OFFile *of_stderr;