<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Aerialarts &#187; Carbon</title>
	<atom:link href="http://aerial.st/tags/carbon/feed/" rel="self" type="application/rss+xml" />
	<link>http://aerial.st</link>
	<description></description>
	<lastBuildDate>Mon, 16 Jan 2012 09:56:44 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/tags/carbon/feed/" />
		<item>
		<title>Carbonの新APIによる、Finder経由でのファイル削除</title>
		<link>http://aerial.st/archive/2008/11/13/move-to-trash-with-carbo/</link>
		<comments>http://aerial.st/archive/2008/11/13/move-to-trash-with-carbo/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 14:52:47 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Carbon]]></category>
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=433</guid>
		<description><![CDATA[以前はAppleScript経由で面倒っぽかったけど、LeopardからCarbonにAPIが加わったらしい。 CarbonCore Framework Release Notes for Mac OS X v10.5 追記 @ 2009-03-23 とりあえず以下のコードで動くっぽい。要&#60;CoreServices/CoreServices.h>。 - (BOOL)moveFileToTrash:(NSString *)filename { FSRef fileRef; // 対象の存在をチェック if(![[NSFileManager defaultManager] fileExistsAtPath:filename]) return NO; // FSRefの取得（ちなみにコードを拝借したCocoaDVDPlayerではUTF-8ではなくASCIIにしてた） //const char *cPath = [filename UTF8String]; // 追記その2参照 const char *cPath = [filename fileSystemRepresentation]; OSStatus result = FSPathMakeRef ((UInt8*)cPath, &#38;fileRef, NULL); if (result != noErr) return NO; // ゴミ箱に移動 // オプションはテキトー。Finderのような効果音は別途処理を記述する必要あり result = FSMoveObjectToTrashSync(&#38;fileRef, NULL, kFSFileOperationDefaultOptions); return (result == noErr); } 追記その2 @ 2009-03-28 Cocoa Study Blogの記事のコメントによると、UTF8StringではなくfileSystemRepresentationにすべきだろうとのこと。確かに、現在はUTF-8が使われてるけど、将来的には変更される可能性もあるし、こっちを使った方がいいかも。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2008/11/13/move-to-trash-with-carbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2008/11/13/move-to-trash-with-carbo/" />
	</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: aerial.st @ 2012-02-09 02:11:07 -->
