ObjFW  Check-in [169f06e1ec]

Overview
Comment:Add +[OFFile copyItemAtPath:toPath:].

This replaces +[OFFile copyFileAtPath:toPath:].

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 169f06e1ec5ec79d6470be12d1ac689f90e7f5b4a39101362c79993be832f285
User & Date: js on 2013-12-09 22:19:30
Other Links: manifest | tags
Context
2013-12-09
23:24
+[OFFile copyFileAtPath:toPath:]: Win32 stuff. check-in: aefb143a8d user: js tags: trunk
22:19
Add +[OFFile copyItemAtPath:toPath:]. check-in: 169f06e1ec user: js tags: trunk
22:08
Add +[OFFile symbolicLinkExistsAtPath:]. check-in: f193f3fa8c user: js tags: trunk
Changes

Modified ObjFW.xcodeproj/project.pbxproj from [1e2dbae5f7] to [3b34a979f0].

110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
		4B23CA92133811DC0047A1D9 /* TestPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6EF684123535B60076B512 /* TestPlugin.m */; };
		4B23CA93133811E20047A1D9 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B3D23761337FBC800DD29B8 /* ObjFW.framework */; };
		4B23CA941338121C0047A1D9 /* TestPlugin.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B23CA8A133811610047A1D9 /* TestPlugin.bundle */; };
		4B29BC3F133AC4E80004B236 /* OFCreateDirectoryFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC40133AC4E80004B236 /* OFCreateDirectoryFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */; };
		4B29BC41133AC4E80004B236 /* OFSeekFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC39133AC4E80004B236 /* OFSeekFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC42133AC4E80004B236 /* OFSeekFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC3A133AC4E80004B236 /* OFSeekFailedException.m */; };
		4B29BC4E133AC7DD0004B236 /* OFCopyFileFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC46133AC7DB0004B236 /* OFCopyFileFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC4F133AC7DD0004B236 /* OFCopyFileFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC47133AC7DB0004B236 /* OFCopyFileFailedException.m */; };
		4B29BC58133AC8540004B236 /* OFConditionBroadcastFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1701133A3B8E007CD8B3 /* OFConditionBroadcastFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC59133AC8540004B236 /* OFConditionSignalFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1703133A3B8E007CD8B3 /* OFConditionSignalFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC5A133AC8540004B236 /* OFConditionWaitFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1705133A3B8E007CD8B3 /* OFConditionWaitFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC61133AC9CB0004B236 /* OFLinkFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC5D133AC9C40004B236 /* OFLinkFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC62133AC9CB0004B236 /* OFLinkFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC5E133AC9C40004B236 /* OFLinkFailedException.m */; };
		4B2B3E7D140D430500EC2F7C /* OFArray_adjacent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2B3E73140D430500EC2F7C /* OFArray_adjacent.h */; settings = {ATTRIBUTES = (); }; };
		4B2B3E7E140D430500EC2F7C /* OFArray_adjacent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2B3E74140D430500EC2F7C /* OFArray_adjacent.m */; };







<
<







110
111
112
113
114
115
116


117
118
119
120
121
122
123
		4B23CA92133811DC0047A1D9 /* TestPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6EF684123535B60076B512 /* TestPlugin.m */; };
		4B23CA93133811E20047A1D9 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B3D23761337FBC800DD29B8 /* ObjFW.framework */; };
		4B23CA941338121C0047A1D9 /* TestPlugin.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B23CA8A133811610047A1D9 /* TestPlugin.bundle */; };
		4B29BC3F133AC4E80004B236 /* OFCreateDirectoryFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC40133AC4E80004B236 /* OFCreateDirectoryFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */; };
		4B29BC41133AC4E80004B236 /* OFSeekFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC39133AC4E80004B236 /* OFSeekFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC42133AC4E80004B236 /* OFSeekFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC3A133AC4E80004B236 /* OFSeekFailedException.m */; };


		4B29BC58133AC8540004B236 /* OFConditionBroadcastFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1701133A3B8E007CD8B3 /* OFConditionBroadcastFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC59133AC8540004B236 /* OFConditionSignalFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1703133A3B8E007CD8B3 /* OFConditionSignalFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC5A133AC8540004B236 /* OFConditionWaitFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B8B1705133A3B8E007CD8B3 /* OFConditionWaitFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC61133AC9CB0004B236 /* OFLinkFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B29BC5D133AC9C40004B236 /* OFLinkFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B29BC62133AC9CB0004B236 /* OFLinkFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B29BC5E133AC9C40004B236 /* OFLinkFailedException.m */; };
		4B2B3E7D140D430500EC2F7C /* OFArray_adjacent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2B3E73140D430500EC2F7C /* OFArray_adjacent.h */; settings = {ATTRIBUTES = (); }; };
		4B2B3E7E140D430500EC2F7C /* OFArray_adjacent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2B3E74140D430500EC2F7C /* OFArray_adjacent.m */; };
262
263
264
265
266
267
268


269
270
271
272
273
274
275
		4B55A114133AC24600B58A93 /* OFReadOrWriteFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A10E133AC24500B58A93 /* OFReadOrWriteFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B55A115133AC24600B58A93 /* OFReadOrWriteFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A10F133AC24500B58A93 /* OFReadOrWriteFailedException.m */; };
		4B55A116133AC24600B58A93 /* OFWriteFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A110133AC24500B58A93 /* OFWriteFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B55A117133AC24600B58A93 /* OFWriteFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A111133AC24600B58A93 /* OFWriteFailedException.m */; };
		4B5C112F17E9AB3E003C917F /* forwarding.S in Sources */ = {isa = PBXBuildFile; fileRef = 4B5C112C17E9AAED003C917F /* forwarding.S */; };
		4B5CF8F914940BD2007AA324 /* OFString+JSONValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5CF8F614940BD2007AA324 /* OFString+JSONValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B5CF8FA14940BD2007AA324 /* OFString+JSONValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B5CF8F714940BD2007AA324 /* OFString+JSONValue.m */; };


		4B64D6EF1425381E007BDFB1 /* OFStreamObserver_poll.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B64D6EB1425381E007BDFB1 /* OFStreamObserver_poll.h */; };
		4B64D6F01425381E007BDFB1 /* OFStreamObserver_poll.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B64D6EC1425381E007BDFB1 /* OFStreamObserver_poll.m */; };
		4B64D6F11425381E007BDFB1 /* OFStreamObserver_select.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B64D6ED1425381E007BDFB1 /* OFStreamObserver_select.h */; };
		4B64D6F21425381E007BDFB1 /* OFStreamObserver_select.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B64D6EE1425381E007BDFB1 /* OFStreamObserver_select.m */; };
		4B66B636182ADC45000A69E3 /* OFDeflate64Stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66B634182ADC45000A69E3 /* OFDeflate64Stream.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B66B637182ADC45000A69E3 /* OFDeflate64Stream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B66B635182ADC45000A69E3 /* OFDeflate64Stream.m */; };
		4B6743F1163C384A00EB1E59 /* OFLockFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6743EB163C384A00EB1E59 /* OFLockFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };







>
>







260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
		4B55A114133AC24600B58A93 /* OFReadOrWriteFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A10E133AC24500B58A93 /* OFReadOrWriteFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B55A115133AC24600B58A93 /* OFReadOrWriteFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A10F133AC24500B58A93 /* OFReadOrWriteFailedException.m */; };
		4B55A116133AC24600B58A93 /* OFWriteFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B55A110133AC24500B58A93 /* OFWriteFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B55A117133AC24600B58A93 /* OFWriteFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B55A111133AC24600B58A93 /* OFWriteFailedException.m */; };
		4B5C112F17E9AB3E003C917F /* forwarding.S in Sources */ = {isa = PBXBuildFile; fileRef = 4B5C112C17E9AAED003C917F /* forwarding.S */; };
		4B5CF8F914940BD2007AA324 /* OFString+JSONValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5CF8F614940BD2007AA324 /* OFString+JSONValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B5CF8FA14940BD2007AA324 /* OFString+JSONValue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B5CF8F714940BD2007AA324 /* OFString+JSONValue.m */; };
		4B62ED1518566FCA0004E0E3 /* OFCopyItemFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B62ED1318566FCA0004E0E3 /* OFCopyItemFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B62ED1618566FCA0004E0E3 /* OFCopyItemFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B62ED1418566FCA0004E0E3 /* OFCopyItemFailedException.m */; };
		4B64D6EF1425381E007BDFB1 /* OFStreamObserver_poll.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B64D6EB1425381E007BDFB1 /* OFStreamObserver_poll.h */; };
		4B64D6F01425381E007BDFB1 /* OFStreamObserver_poll.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B64D6EC1425381E007BDFB1 /* OFStreamObserver_poll.m */; };
		4B64D6F11425381E007BDFB1 /* OFStreamObserver_select.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B64D6ED1425381E007BDFB1 /* OFStreamObserver_select.h */; };
		4B64D6F21425381E007BDFB1 /* OFStreamObserver_select.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B64D6EE1425381E007BDFB1 /* OFStreamObserver_select.m */; };
		4B66B636182ADC45000A69E3 /* OFDeflate64Stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B66B634182ADC45000A69E3 /* OFDeflate64Stream.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B66B637182ADC45000A69E3 /* OFDeflate64Stream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B66B635182ADC45000A69E3 /* OFDeflate64Stream.m */; };
		4B6743F1163C384A00EB1E59 /* OFLockFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6743EB163C384A00EB1E59 /* OFLockFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
		4B19023A1338D6A2000374C9 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = src/Makefile; sourceTree = SOURCE_ROOT; };
		4B19023D1338D6D5000374C9 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = tests/Makefile; sourceTree = "<group>"; };
		4B23CA8A133811610047A1D9 /* TestPlugin.bundle */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = TestPlugin.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
		4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCreateDirectoryFailedException.h; path = src/exceptions/OFCreateDirectoryFailedException.h; sourceTree = "<group>"; };
		4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFCreateDirectoryFailedException.m; path = src/exceptions/OFCreateDirectoryFailedException.m; sourceTree = "<group>"; };
		4B29BC39133AC4E80004B236 /* OFSeekFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSeekFailedException.h; path = src/exceptions/OFSeekFailedException.h; sourceTree = "<group>"; };
		4B29BC3A133AC4E80004B236 /* OFSeekFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSeekFailedException.m; path = src/exceptions/OFSeekFailedException.m; sourceTree = "<group>"; };
		4B29BC46133AC7DB0004B236 /* OFCopyFileFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCopyFileFailedException.h; path = src/exceptions/OFCopyFileFailedException.h; sourceTree = "<group>"; };
		4B29BC47133AC7DB0004B236 /* OFCopyFileFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFCopyFileFailedException.m; path = src/exceptions/OFCopyFileFailedException.m; sourceTree = "<group>"; };
		4B29BC5D133AC9C40004B236 /* OFLinkFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFLinkFailedException.h; path = src/exceptions/OFLinkFailedException.h; sourceTree = "<group>"; };
		4B29BC5E133AC9C40004B236 /* OFLinkFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFLinkFailedException.m; path = src/exceptions/OFLinkFailedException.m; sourceTree = "<group>"; };
		4B2B3E73140D430500EC2F7C /* OFArray_adjacent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFArray_adjacent.h; path = src/OFArray_adjacent.h; sourceTree = "<group>"; };
		4B2B3E74140D430500EC2F7C /* OFArray_adjacent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFArray_adjacent.m; path = src/OFArray_adjacent.m; sourceTree = "<group>"; };
		4B2B3E75140D430500EC2F7C /* OFDictionary_hashtable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDictionary_hashtable.h; path = src/OFDictionary_hashtable.h; sourceTree = "<group>"; };
		4B2B3E76140D430500EC2F7C /* OFDictionary_hashtable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDictionary_hashtable.m; path = src/OFDictionary_hashtable.m; sourceTree = "<group>"; };
		4B2B3E77140D430500EC2F7C /* OFMutableArray_adjacent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutableArray_adjacent.h; path = src/OFMutableArray_adjacent.h; sourceTree = "<group>"; };







<
<







565
566
567
568
569
570
571


572
573
574
575
576
577
578
		4B19023A1338D6A2000374C9 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = src/Makefile; sourceTree = SOURCE_ROOT; };
		4B19023D1338D6D5000374C9 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = tests/Makefile; sourceTree = "<group>"; };
		4B23CA8A133811610047A1D9 /* TestPlugin.bundle */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = TestPlugin.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
		4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCreateDirectoryFailedException.h; path = src/exceptions/OFCreateDirectoryFailedException.h; sourceTree = "<group>"; };
		4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFCreateDirectoryFailedException.m; path = src/exceptions/OFCreateDirectoryFailedException.m; sourceTree = "<group>"; };
		4B29BC39133AC4E80004B236 /* OFSeekFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFSeekFailedException.h; path = src/exceptions/OFSeekFailedException.h; sourceTree = "<group>"; };
		4B29BC3A133AC4E80004B236 /* OFSeekFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSeekFailedException.m; path = src/exceptions/OFSeekFailedException.m; sourceTree = "<group>"; };


		4B29BC5D133AC9C40004B236 /* OFLinkFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFLinkFailedException.h; path = src/exceptions/OFLinkFailedException.h; sourceTree = "<group>"; };
		4B29BC5E133AC9C40004B236 /* OFLinkFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFLinkFailedException.m; path = src/exceptions/OFLinkFailedException.m; sourceTree = "<group>"; };
		4B2B3E73140D430500EC2F7C /* OFArray_adjacent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFArray_adjacent.h; path = src/OFArray_adjacent.h; sourceTree = "<group>"; };
		4B2B3E74140D430500EC2F7C /* OFArray_adjacent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFArray_adjacent.m; path = src/OFArray_adjacent.m; sourceTree = "<group>"; };
		4B2B3E75140D430500EC2F7C /* OFDictionary_hashtable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDictionary_hashtable.h; path = src/OFDictionary_hashtable.h; sourceTree = "<group>"; };
		4B2B3E76140D430500EC2F7C /* OFDictionary_hashtable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDictionary_hashtable.m; path = src/OFDictionary_hashtable.m; sourceTree = "<group>"; };
		4B2B3E77140D430500EC2F7C /* OFMutableArray_adjacent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutableArray_adjacent.h; path = src/OFMutableArray_adjacent.h; sourceTree = "<group>"; };
635
636
637
638
639
640
641


642
643
644
645
646
647
648
		4B5C112917E9AAED003C917F /* apple-forwarding-i386.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; name = "apple-forwarding-i386.S"; path = "src/forwarding/apple-forwarding-i386.S"; sourceTree = "<group>"; };
		4B5C112A17E9AAED003C917F /* apple-forwarding-ppc.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; name = "apple-forwarding-ppc.S"; path = "src/forwarding/apple-forwarding-ppc.S"; sourceTree = "<group>"; };
		4B5C112B17E9AAED003C917F /* apple-forwarding-x86_64.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; name = "apple-forwarding-x86_64.S"; path = "src/forwarding/apple-forwarding-x86_64.S"; sourceTree = "<group>"; };
		4B5C112C17E9AAED003C917F /* forwarding.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; name = forwarding.S; path = src/forwarding/forwarding.S; sourceTree = "<group>"; };
		4B5C112E17E9AB0C003C917F /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = src/forwarding/Makefile; sourceTree = "<group>"; };
		4B5CF8F614940BD2007AA324 /* OFString+JSONValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OFString+JSONValue.h"; path = "src/OFString+JSONValue.h"; sourceTree = "<group>"; };
		4B5CF8F714940BD2007AA324 /* OFString+JSONValue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OFString+JSONValue.m"; path = "src/OFString+JSONValue.m"; sourceTree = "<group>"; };


		4B64D6EB1425381E007BDFB1 /* OFStreamObserver_poll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFStreamObserver_poll.h; path = src/OFStreamObserver_poll.h; sourceTree = "<group>"; };
		4B64D6EC1425381E007BDFB1 /* OFStreamObserver_poll.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFStreamObserver_poll.m; path = src/OFStreamObserver_poll.m; sourceTree = "<group>"; };
		4B64D6ED1425381E007BDFB1 /* OFStreamObserver_select.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFStreamObserver_select.h; path = src/OFStreamObserver_select.h; sourceTree = "<group>"; };
		4B64D6EE1425381E007BDFB1 /* OFStreamObserver_select.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFStreamObserver_select.m; path = src/OFStreamObserver_select.m; sourceTree = "<group>"; };
		4B66B634182ADC45000A69E3 /* OFDeflate64Stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDeflate64Stream.h; path = src/OFDeflate64Stream.h; sourceTree = "<group>"; };
		4B66B635182ADC45000A69E3 /* OFDeflate64Stream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDeflate64Stream.m; path = src/OFDeflate64Stream.m; sourceTree = "<group>"; };
		4B6743EB163C384A00EB1E59 /* OFLockFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFLockFailedException.h; path = src/exceptions/OFLockFailedException.h; sourceTree = "<group>"; };







>
>







633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
		4B5C112917E9AAED003C917F /* apple-forwarding-i386.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; name = "apple-forwarding-i386.S"; path = "src/forwarding/apple-forwarding-i386.S"; sourceTree = "<group>"; };
		4B5C112A17E9AAED003C917F /* apple-forwarding-ppc.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; name = "apple-forwarding-ppc.S"; path = "src/forwarding/apple-forwarding-ppc.S"; sourceTree = "<group>"; };
		4B5C112B17E9AAED003C917F /* apple-forwarding-x86_64.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; name = "apple-forwarding-x86_64.S"; path = "src/forwarding/apple-forwarding-x86_64.S"; sourceTree = "<group>"; };
		4B5C112C17E9AAED003C917F /* forwarding.S */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; name = forwarding.S; path = src/forwarding/forwarding.S; sourceTree = "<group>"; };
		4B5C112E17E9AB0C003C917F /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = Makefile; path = src/forwarding/Makefile; sourceTree = "<group>"; };
		4B5CF8F614940BD2007AA324 /* OFString+JSONValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OFString+JSONValue.h"; path = "src/OFString+JSONValue.h"; sourceTree = "<group>"; };
		4B5CF8F714940BD2007AA324 /* OFString+JSONValue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OFString+JSONValue.m"; path = "src/OFString+JSONValue.m"; sourceTree = "<group>"; };
		4B62ED1318566FCA0004E0E3 /* OFCopyItemFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCopyItemFailedException.h; path = src/exceptions/OFCopyItemFailedException.h; sourceTree = "<group>"; };
		4B62ED1418566FCA0004E0E3 /* OFCopyItemFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFCopyItemFailedException.m; path = src/exceptions/OFCopyItemFailedException.m; sourceTree = "<group>"; };
		4B64D6EB1425381E007BDFB1 /* OFStreamObserver_poll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFStreamObserver_poll.h; path = src/OFStreamObserver_poll.h; sourceTree = "<group>"; };
		4B64D6EC1425381E007BDFB1 /* OFStreamObserver_poll.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFStreamObserver_poll.m; path = src/OFStreamObserver_poll.m; sourceTree = "<group>"; };
		4B64D6ED1425381E007BDFB1 /* OFStreamObserver_select.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFStreamObserver_select.h; path = src/OFStreamObserver_select.h; sourceTree = "<group>"; };
		4B64D6EE1425381E007BDFB1 /* OFStreamObserver_select.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFStreamObserver_select.m; path = src/OFStreamObserver_select.m; sourceTree = "<group>"; };
		4B66B634182ADC45000A69E3 /* OFDeflate64Stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFDeflate64Stream.h; path = src/OFDeflate64Stream.h; sourceTree = "<group>"; };
		4B66B635182ADC45000A69E3 /* OFDeflate64Stream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFDeflate64Stream.m; path = src/OFDeflate64Stream.m; sourceTree = "<group>"; };
		4B6743EB163C384A00EB1E59 /* OFLockFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFLockFailedException.h; path = src/exceptions/OFLockFailedException.h; sourceTree = "<group>"; };
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
				4B8B1704133A3B8E007CD8B3 /* OFConditionSignalFailedException.m */,
				4B7FF3B2133CED6100000324 /* OFConditionStillWaitingException.h */,
				4B7FF3B3133CED6100000324 /* OFConditionStillWaitingException.m */,
				4B8B1705133A3B8E007CD8B3 /* OFConditionWaitFailedException.h */,
				4B8B1706133A3B8E007CD8B3 /* OFConditionWaitFailedException.m */,
				4B90B79A133AD87D00BD33CB /* OFConnectionFailedException.h */,
				4B90B79B133AD87D00BD33CB /* OFConnectionFailedException.m */,
				4B29BC46133AC7DB0004B236 /* OFCopyFileFailedException.h */,
				4B29BC47133AC7DB0004B236 /* OFCopyFileFailedException.m */,
				4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */,
				4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */,
				4B067FB5177BA6F900B8CFDA /* OFCreateSymbolicLinkFailedException.h */,
				4B067FB6177BA6F900B8CFDA /* OFCreateSymbolicLinkFailedException.m */,
				4B17FF85133A2E7A003E6DCD /* OFEnumerationMutationException.h */,
				4B17FF86133A2E7A003E6DCD /* OFEnumerationMutationException.m */,
				4B17FF70133A28FC003E6DCD /* OFException.h */,







|
|







951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
				4B8B1704133A3B8E007CD8B3 /* OFConditionSignalFailedException.m */,
				4B7FF3B2133CED6100000324 /* OFConditionStillWaitingException.h */,
				4B7FF3B3133CED6100000324 /* OFConditionStillWaitingException.m */,
				4B8B1705133A3B8E007CD8B3 /* OFConditionWaitFailedException.h */,
				4B8B1706133A3B8E007CD8B3 /* OFConditionWaitFailedException.m */,
				4B90B79A133AD87D00BD33CB /* OFConnectionFailedException.h */,
				4B90B79B133AD87D00BD33CB /* OFConnectionFailedException.m */,
				4B62ED1318566FCA0004E0E3 /* OFCopyItemFailedException.h */,
				4B62ED1418566FCA0004E0E3 /* OFCopyItemFailedException.m */,
				4B29BC37133AC4E80004B236 /* OFCreateDirectoryFailedException.h */,
				4B29BC38133AC4E80004B236 /* OFCreateDirectoryFailedException.m */,
				4B067FB5177BA6F900B8CFDA /* OFCreateSymbolicLinkFailedException.h */,
				4B067FB6177BA6F900B8CFDA /* OFCreateSymbolicLinkFailedException.m */,
				4B17FF85133A2E7A003E6DCD /* OFEnumerationMutationException.h */,
				4B17FF86133A2E7A003E6DCD /* OFEnumerationMutationException.m */,
				4B17FF70133A28FC003E6DCD /* OFException.h */,
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
				4B067FBF177BA6F900B8CFDA /* OFChangePermissionsFailedException.h in Headers */,
				4BE52D2517B990DA005958D1 /* OFChecksumFailedException.h in Headers */,
				4B29BC58133AC8540004B236 /* OFConditionBroadcastFailedException.h in Headers */,
				4B29BC59133AC8540004B236 /* OFConditionSignalFailedException.h in Headers */,
				4B7FF3B4133CED6200000324 /* OFConditionStillWaitingException.h in Headers */,
				4B29BC5A133AC8540004B236 /* OFConditionWaitFailedException.h in Headers */,
				4B90B7A4133AD87D00BD33CB /* OFConnectionFailedException.h in Headers */,
				4B29BC4E133AC7DD0004B236 /* OFCopyFileFailedException.h in Headers */,
				4B29BC3F133AC4E80004B236 /* OFCreateDirectoryFailedException.h in Headers */,
				4B067FC1177BA6F900B8CFDA /* OFCreateSymbolicLinkFailedException.h in Headers */,
				4B17FF87133A2E7B003E6DCD /* OFEnumerationMutationException.h in Headers */,
				4B8B16FE133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.h in Headers */,
				4B17FFAD133A3591003E6DCD /* OFHTTPRequestFailedException.h in Headers */,
				4B17FFA5133A3411003E6DCD /* OFInitializationFailedException.h in Headers */,
				4B17FF93133A317C003E6DCD /* OFInvalidArgumentException.h in Headers */,







|







1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
				4B067FBF177BA6F900B8CFDA /* OFChangePermissionsFailedException.h in Headers */,
				4BE52D2517B990DA005958D1 /* OFChecksumFailedException.h in Headers */,
				4B29BC58133AC8540004B236 /* OFConditionBroadcastFailedException.h in Headers */,
				4B29BC59133AC8540004B236 /* OFConditionSignalFailedException.h in Headers */,
				4B7FF3B4133CED6200000324 /* OFConditionStillWaitingException.h in Headers */,
				4B29BC5A133AC8540004B236 /* OFConditionWaitFailedException.h in Headers */,
				4B90B7A4133AD87D00BD33CB /* OFConnectionFailedException.h in Headers */,
				4B62ED1518566FCA0004E0E3 /* OFCopyItemFailedException.h in Headers */,
				4B29BC3F133AC4E80004B236 /* OFCreateDirectoryFailedException.h in Headers */,
				4B067FC1177BA6F900B8CFDA /* OFCreateSymbolicLinkFailedException.h in Headers */,
				4B17FF87133A2E7B003E6DCD /* OFEnumerationMutationException.h in Headers */,
				4B8B16FE133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.h in Headers */,
				4B17FFAD133A3591003E6DCD /* OFHTTPRequestFailedException.h in Headers */,
				4B17FFA5133A3411003E6DCD /* OFInitializationFailedException.h in Headers */,
				4B17FF93133A317C003E6DCD /* OFInvalidArgumentException.h in Headers */,
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
				4B067FC0177BA6F900B8CFDA /* OFChangePermissionsFailedException.m in Sources */,
				4BE52D2617B990DA005958D1 /* OFChecksumFailedException.m in Sources */,
				4B8B170D133A3C11007CD8B3 /* OFConditionBroadcastFailedException.m in Sources */,
				4B8B170E133A3C11007CD8B3 /* OFConditionSignalFailedException.m in Sources */,
				4B7FF3B5133CED6200000324 /* OFConditionStillWaitingException.m in Sources */,
				4B8B170F133A3C11007CD8B3 /* OFConditionWaitFailedException.m in Sources */,
				4B90B7A5133AD87D00BD33CB /* OFConnectionFailedException.m in Sources */,
				4B29BC4F133AC7DD0004B236 /* OFCopyFileFailedException.m in Sources */,
				4B29BC40133AC4E80004B236 /* OFCreateDirectoryFailedException.m in Sources */,
				4B067FC2177BA6F900B8CFDA /* OFCreateSymbolicLinkFailedException.m in Sources */,
				4B17FF88133A2E7B003E6DCD /* OFEnumerationMutationException.m in Sources */,
				4B17FF73133A2A76003E6DCD /* OFException.m in Sources */,
				4B8B16FF133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.m in Sources */,
				4B17FFAE133A3591003E6DCD /* OFHTTPRequestFailedException.m in Sources */,
				4B17FFA6133A3411003E6DCD /* OFInitializationFailedException.m in Sources */,







|







1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
				4B067FC0177BA6F900B8CFDA /* OFChangePermissionsFailedException.m in Sources */,
				4BE52D2617B990DA005958D1 /* OFChecksumFailedException.m in Sources */,
				4B8B170D133A3C11007CD8B3 /* OFConditionBroadcastFailedException.m in Sources */,
				4B8B170E133A3C11007CD8B3 /* OFConditionSignalFailedException.m in Sources */,
				4B7FF3B5133CED6200000324 /* OFConditionStillWaitingException.m in Sources */,
				4B8B170F133A3C11007CD8B3 /* OFConditionWaitFailedException.m in Sources */,
				4B90B7A5133AD87D00BD33CB /* OFConnectionFailedException.m in Sources */,
				4B62ED1618566FCA0004E0E3 /* OFCopyItemFailedException.m in Sources */,
				4B29BC40133AC4E80004B236 /* OFCreateDirectoryFailedException.m in Sources */,
				4B067FC2177BA6F900B8CFDA /* OFCreateSymbolicLinkFailedException.m in Sources */,
				4B17FF88133A2E7B003E6DCD /* OFEnumerationMutationException.m in Sources */,
				4B17FF73133A2A76003E6DCD /* OFException.m in Sources */,
				4B8B16FF133A3B84007CD8B3 /* OFHashAlreadyCalculatedException.m in Sources */,
				4B17FFAE133A3591003E6DCD /* OFHTTPRequestFailedException.m in Sources */,
				4B17FFA6133A3411003E6DCD /* OFInitializationFailedException.m in Sources */,

Modified src/OFFile.h from [35a5c807f1] to [31d02bd727].

174
175
176
177
178
179
180
181
182



183
184
185
186
187
188
189
190
191
192
193
 */
+ (void)changeOwnerOfItemAtPath: (OFString*)path
			  owner: (OFString*)owner
			  group: (OFString*)group;
#endif

/*!
 * @brief Copies a file.
 *



 * @param source The file to copy
 * @param destination The destination path
 */
+ (void)copyFileAtPath: (OFString*)source
		toPath: (OFString*)destination;

/*!
 * @brief Renames an item.
 *
 * @param source The item to rename
 * @param destination The new name for the item







|

>
>
>
|


|







174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
 */
+ (void)changeOwnerOfItemAtPath: (OFString*)path
			  owner: (OFString*)owner
			  group: (OFString*)group;
#endif

/*!
 * @brief Copies a file, directory or symlink (if supported by the OS).
 *
 * If an item already exists, it is replaced. This is also the case if a
 * directory is copied and an item already exists in the destination directory.
 *
 * @param source The file, directory or symlink to copy
 * @param destination The destination path
 */
+ (void)copyItemAtPath: (OFString*)source
		toPath: (OFString*)destination;

/*!
 * @brief Renames an item.
 *
 * @param source The item to rename
 * @param destination The new name for the item

Modified src/OFFile.m from [9780f15c6e] to [0ee3c33822].

56
57
58
59
60
61
62

63
64
65
66
67
68
69
#endif
#import "OFDate.h"
#import "OFSystemInfo.h"

#import "OFChangeCurrentDirectoryPathFailedException.h"
#import "OFChangeOwnerFailedException.h"
#import "OFChangePermissionsFailedException.h"

#import "OFCreateDirectoryFailedException.h"
#import "OFCreateSymbolicLinkFailedException.h"
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFLinkFailedException.h"
#import "OFLockFailedException.h"
#import "OFOpenFileFailedException.h"







>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#endif
#import "OFDate.h"
#import "OFSystemInfo.h"

#import "OFChangeCurrentDirectoryPathFailedException.h"
#import "OFChangeOwnerFailedException.h"
#import "OFChangePermissionsFailedException.h"
#import "OFCopyItemFailedException.h"
#import "OFCreateDirectoryFailedException.h"
#import "OFCreateSymbolicLinkFailedException.h"
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFLinkFailedException.h"
#import "OFLockFailedException.h"
#import "OFOpenFileFailedException.h"
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552







553

554



555
556
557
558
559
560





561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585




586
587
588
589
590




























































591
592
593
594
595
596
597
	    uid, gid))
		@throw [OFChangeOwnerFailedException exceptionWithPath: path
								 owner: owner
								 group: group];
}
#endif

+ (void)copyFileAtPath: (OFString*)source
		toPath: (OFString*)destination
{
	void *pool;
	bool override;
	OFFile *sourceFile = nil;
	OFFile *destinationFile = nil;
	char *buffer;
	size_t pageSize;

	if (source == nil || destination == nil)
		@throw [OFInvalidArgumentException exception];

	pool = objc_autoreleasePoolPush();

	if ([self directoryExistsAtPath: destination]) {
		OFArray *components = [OFArray arrayWithObjects:
		    destination, [source lastPathComponent], nil];
		destination = [OFString pathWithComponents: components];
	}








	override = [self fileExistsAtPath: destination];

	pageSize = [OFSystemInfo pageSize];




	if ((buffer = malloc(pageSize)) == NULL)
		@throw [OFOutOfMemoryException
		    exceptionWithRequestedSize: pageSize];

	@try {





		sourceFile = [OFFile fileWithPath: source
					     mode: @"rb"];
		destinationFile = [OFFile fileWithPath: destination
						  mode: @"wb"];

		while (![sourceFile isAtEndOfStream]) {
			size_t length;

			length = [sourceFile readIntoBuffer: buffer
						     length: pageSize];
			[destinationFile writeBuffer: buffer
					      length: length];
		}

#ifdef OF_HAVE_CHMOD
		if (!override) {
			struct stat s;

			if (fstat(sourceFile->_fd, &s) == 0)
				[self changePermissionsOfItemAtPath: destination
							permissions: s.st_mode];
		}
#else
		(void)override;
#endif




	} @finally {
		[sourceFile close];
		[destinationFile close];
		free(buffer);
	}





























































	objc_autoreleasePoolPop(pool);
}

+ (void)renameItemAtPath: (OFString*)source
		  toPath: (OFString*)destination
{







|



<
<
<
<
|












>
>
>
>
>
>
>
|
>
|
>
>
>

|
|
|

|
>
>
>
>
>
|
|
|
|

|
|

|
|
|
|
|


|
<
<
<


<
<
<

>
>
>
>
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







526
527
528
529
530
531
532
533
534
535
536




537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589



590
591



592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
	    uid, gid))
		@throw [OFChangeOwnerFailedException exceptionWithPath: path
								 owner: owner
								 group: group];
}
#endif

+ (void)copyItemAtPath: (OFString*)source
		toPath: (OFString*)destination
{
	void *pool;




	struct stat s;

	if (source == nil || destination == nil)
		@throw [OFInvalidArgumentException exception];

	pool = objc_autoreleasePoolPush();

	if ([self directoryExistsAtPath: destination]) {
		OFArray *components = [OFArray arrayWithObjects:
		    destination, [source lastPathComponent], nil];
		destination = [OFString pathWithComponents: components];
	}

	if (lstat([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], &s))
		@throw [OFCopyItemFailedException
		    exceptionWithSourcePath: source
			    destinationPath: destination];

	if (S_ISREG(s.st_mode)) {
#ifdef OF_HAVE_CHMOD
		bool override = [self fileExistsAtPath: destination];
#endif
		size_t pageSize = [OFSystemInfo pageSize];
		OFFile *sourceFile = nil;
		OFFile *destinationFile = nil;
		char *buffer;

		if ((buffer = malloc(pageSize)) == NULL)
			@throw [OFOutOfMemoryException
			    exceptionWithRequestedSize: pageSize];

		@try {
#ifdef OF_HAVE_SYMLINK
			if ([OFFile symbolicLinkExistsAtPath: destination])
				[OFFile removeItemAtPath: destination];
#endif

			sourceFile = [OFFile fileWithPath: source
						     mode: @"rb"];
			destinationFile = [OFFile fileWithPath: destination
							  mode: @"wb"];

			while (![sourceFile isAtEndOfStream]) {
				size_t length;

				length = [sourceFile readIntoBuffer: buffer
							     length: pageSize];
				[destinationFile writeBuffer: buffer
						      length: length];
			}

#ifdef OF_HAVE_CHMOD
			if (!override)



				[self changePermissionsOfItemAtPath: destination
							permissions: s.st_mode];



#endif
		} @catch (id e) {
			@throw [OFCopyItemFailedException
			    exceptionWithSourcePath: source
				    destinationPath: destination];
		} @finally {
			[sourceFile close];
			[destinationFile close];
			free(buffer);
		}
	} else if (S_ISDIR(s.st_mode)) {
		OFArray *contents;
		OFEnumerator *enumerator;
		OFString *item;

		@try {
			if (![OFFile directoryExistsAtPath: destination])
				[OFFile createDirectoryAtPath: destination];

#ifdef OF_HAVE_CHMOD
			[OFFile changePermissionsOfItemAtPath: destination
						  permissions: s.st_mode];
#endif

			contents = [OFFile contentsOfDirectoryAtPath: source];
		} @catch (id e) {
			@throw [OFCopyItemFailedException
			    exceptionWithSourcePath: source
				    destinationPath: destination];
		}

		enumerator = [contents objectEnumerator];
		while ((item = [enumerator nextObject]) != nil) {
			OFArray *components;
			OFString *sourcePath, *destinationPath;

			components = [OFArray arrayWithObjects:
			    source, item, nil];
			sourcePath = [OFString pathWithComponents: components];

			components = [OFArray arrayWithObjects:
			    destination, item, nil];
			destinationPath = [OFString
			    pathWithComponents: components];

			[OFFile copyItemAtPath: sourcePath
					toPath: destinationPath];
		}
#ifdef OF_HAVE_SYMLINK
	} else if (S_ISLNK(s.st_mode)) {
		@try {
			if ([OFFile symbolicLinkExistsAtPath: destination] ||
			    [OFFile fileExistsAtPath: destination])
				[OFFile removeItemAtPath: destination];

			source = [OFFile
			    destinationOfSymbolicLinkAtPath: source];

			[OFFile createSymbolicLinkAtPath: destination
				     withDestinationPath: source];
		} @catch (id e) {
			@throw [OFCopyItemFailedException
			    exceptionWithSourcePath: source
				    destinationPath: destination];
		}
#endif
	} else
		@throw [OFCopyItemFailedException
		    exceptionWithSourcePath: source
			    destinationPath: destination];

	objc_autoreleasePoolPop(pool);
}

+ (void)renameItemAtPath: (OFString*)source
		  toPath: (OFString*)destination
{

Modified src/ObjFW.h from [c15234d226] to [9ac65f6b1e].

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# import "OFConditionSignalFailedException.h"
# import "OFConditionStillWaitingException.h"
# import "OFConditionWaitFailedException.h"
#endif
#ifdef OF_HAVE_SOCKETS
# import "OFConnectionFailedException.h"
#endif
#import "OFCopyFileFailedException.h"
#import "OFCreateDirectoryFailedException.h"
#import "OFCreateSymbolicLinkFailedException.h"
#import "OFEnumerationMutationException.h"
#import "OFHashAlreadyCalculatedException.h"
#ifdef OF_HAVE_SOCKETS
# import "OFHTTPRequestFailedException.h"
#endif







|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# import "OFConditionSignalFailedException.h"
# import "OFConditionStillWaitingException.h"
# import "OFConditionWaitFailedException.h"
#endif
#ifdef OF_HAVE_SOCKETS
# import "OFConnectionFailedException.h"
#endif
#import "OFCopyItemFailedException.h"
#import "OFCreateDirectoryFailedException.h"
#import "OFCreateSymbolicLinkFailedException.h"
#import "OFEnumerationMutationException.h"
#import "OFHashAlreadyCalculatedException.h"
#ifdef OF_HAVE_SOCKETS
# import "OFHTTPRequestFailedException.h"
#endif

Modified src/exceptions/Makefile from [99a0658ee8] to [8ebf1a51cc].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
include ../../extra.mk

STATIC_PIC_LIB_NOINST = ${EXCEPTIONS_LIB_A}
STATIC_LIB_NOINST = ${EXCEPTIONS_A}

SRCS = OFAllocFailedException.m				\
       OFChangeCurrentDirectoryPathFailedException.m	\
       OFChangeOwnerFailedException.m			\
       OFChangePermissionsFailedException.m		\
       OFChecksumFailedException.m			\
       OFCopyFileFailedException.m			\
       OFCreateDirectoryFailedException.m		\
       OFCreateSymbolicLinkFailedException.m		\
       OFEnumerationMutationException.m			\
       OFException.m					\
       OFHashAlreadyCalculatedException.m		\
       OFInitializationFailedException.m		\
       OFInvalidArgumentException.m			\










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
include ../../extra.mk

STATIC_PIC_LIB_NOINST = ${EXCEPTIONS_LIB_A}
STATIC_LIB_NOINST = ${EXCEPTIONS_A}

SRCS = OFAllocFailedException.m				\
       OFChangeCurrentDirectoryPathFailedException.m	\
       OFChangeOwnerFailedException.m			\
       OFChangePermissionsFailedException.m		\
       OFChecksumFailedException.m			\
       OFCopyItemFailedException.m			\
       OFCreateDirectoryFailedException.m		\
       OFCreateSymbolicLinkFailedException.m		\
       OFEnumerationMutationException.m			\
       OFException.m					\
       OFHashAlreadyCalculatedException.m		\
       OFInitializationFailedException.m		\
       OFInvalidArgumentException.m			\

Deleted src/exceptions/OFCopyFileFailedException.h version [ef3edabe1c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include <errno.h>

#import "OFException.h"

/*!
 * @brief An exception indicating that copying a file failed.
 */
@interface OFCopyFileFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *sourcePath;
@property (readonly, copy) OFString *destinationPath;
@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased copy file failed exception.
 *
 * @param sourcePath The original path
 * @param destinationPath The new path
 * @return A new, autoreleased copy file failed exception
 */
+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath;

/*!
 * @brief Initializes an already allocated copy file failed exception.
 *
 * @param sourcePath The original path
 * @param destinationPath The new path
 * @return An initialized copy file failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath;

/*!
 * @brief Returns the path of the source file.
 *
 * @return The path of the source file
 */
- (OFString*)sourcePath;

/*!
 * @brief Returns the destination path.
 *
 * @return The destination path
 */
- (OFString*)destinationPath;

/*!
 * @brief Returns the errno from when the exception was created.
 *
 * @return The errno from when the exception was created
 */
- (int)errNo;
@end
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































































































Deleted src/exceptions/OFCopyFileFailedException.m version [72ed5cf0b0].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#import "OFCopyFileFailedException.h"
#import "OFString.h"

#import "common.h"
#import "macros.h"

@implementation OFCopyFileFailedException
+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
{
	self = [super init];

	@try {
		_sourcePath = [sourcePath copy];
		_destinationPath = [destinationPath copy];
		_errNo = GET_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_sourcePath release];
	[_destinationPath release];

	[super dealloc];
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to copy file %@ to %@! " ERRFMT, _sourcePath,
	    _destinationPath, ERRPARAM];
}

- (OFString*)sourcePath
{
	OF_GETTER(_sourcePath, true)
}

- (OFString*)destinationPath
{
	OF_GETTER(_destinationPath, true)
}

- (int)errNo
{
	return _errNo;
}
@end
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































































Added src/exceptions/OFCopyItemFailedException.h version [05f4995b62].

























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include <errno.h>

#import "OFException.h"

/*!
 * @brief An exception indicating that copying a item failed.
 */
@interface OFCopyItemFailedException: OFException
{
	OFString *_sourcePath, *_destinationPath;
	int _errNo;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *sourcePath;
@property (readonly, copy) OFString *destinationPath;
@property (readonly) int errNo;
#endif

/*!
 * @brief Creates a new, autoreleased copy item failed exception.
 *
 * @param sourcePath The original path
 * @param destinationPath The new path
 * @return A new, autoreleased copy item failed exception
 */
+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath;

/*!
 * @brief Initializes an already allocated copy item failed exception.
 *
 * @param sourcePath The original path
 * @param destinationPath The new path
 * @return An initialized copy item failed exception
 */
- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath;

/*!
 * @brief Returns the path of the source item.
 *
 * @return The path of the source item
 */
- (OFString*)sourcePath;

/*!
 * @brief Returns the destination path.
 *
 * @return The destination path
 */
- (OFString*)destinationPath;

/*!
 * @brief Returns the errno from when the exception was created.
 *
 * @return The errno from when the exception was created
 */
- (int)errNo;
@end

Added src/exceptions/OFCopyItemFailedException.m version [4a42d531cf].









































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#import "OFCopyItemFailedException.h"
#import "OFString.h"

#import "common.h"
#import "macros.h"

@implementation OFCopyItemFailedException
+ (instancetype)exceptionWithSourcePath: (OFString*)sourcePath
			destinationPath: (OFString*)destinationPath
{
	return [[[self alloc] initWithSourcePath: sourcePath
				 destinationPath: destinationPath] autorelease];
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithSourcePath: (OFString*)sourcePath
     destinationPath: (OFString*)destinationPath
{
	self = [super init];

	@try {
		_sourcePath = [sourcePath copy];
		_destinationPath = [destinationPath copy];
		_errNo = GET_ERRNO;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_sourcePath release];
	[_destinationPath release];

	[super dealloc];
}

- (OFString*)description
{
	return [OFString stringWithFormat:
	    @"Failed to copy item %@ to %@! " ERRFMT, _sourcePath,
	    _destinationPath, ERRPARAM];
}

- (OFString*)sourcePath
{
	OF_GETTER(_sourcePath, true)
}

- (OFString*)destinationPath
{
	OF_GETTER(_destinationPath, true)
}

- (int)errNo
{
	return _errNo;
}
@end