ObjFW  Check-in [55d99d15e3]

Overview
Comment:OFFile: Use _wrename() instead of MoveFileW().

Unlike MoveFileW(), _wrename() sets errno.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 55d99d15e3f9c7d471d673dd7b93625fcbdf9f7ce9a518f463abd423ae204e2d
User & Date: js on 2013-01-13 01:19:49
Other Links: manifest | tags
Context
2013-01-13
01:24
OFFile: Make use of _wchmod on Windows. check-in: 06c0c98e78 user: js tags: trunk
01:19
OFFile: Use _wrename() instead of MoveFileW(). check-in: 55d99d15e3 user: js tags: trunk
00:54
OFTCPSocket: Define AI_* to 0 if missing. check-in: 5c6bc745b5 user: js tags: trunk
Changes

Modified src/OFFile.m from [9af0a75ec0] to [214e7cf8ea].

594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
							nil];
	}

#ifndef _WIN32
	if (rename([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE],
	    [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE]))
#else
	if (!MoveFileW([source UTF16String], [destination UTF16String]))
#endif
		@throw [OFRenameFileFailedException
		    exceptionWithClass: self
			    sourcePath: source
		       destinationPath: destination];

	objc_autoreleasePoolPop(pool);







|







594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
							nil];
	}

#ifndef _WIN32
	if (rename([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE],
	    [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE]))
#else
	if (_wrename([source UTF16String], [destination UTF16String]))
#endif
		@throw [OFRenameFileFailedException
		    exceptionWithClass: self
			    sourcePath: source
		       destinationPath: destination];

	objc_autoreleasePoolPop(pool);