<?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/"
	>

<channel>
	<title>ubuntu,debian,redhat -linuxany.com &#187; strcpy</title>
	<atom:link href="http://www.linuxany.com/archives/tag/strcpy/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxany.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 08:59:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>fopen和open的具体区别</title>
		<link>http://www.linuxany.com/archives/902.html</link>
		<comments>http://www.linuxany.com/archives/902.html#comments</comments>
		<pubDate>Wed, 11 Nov 2009 06:15:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[fopen]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[strcpy]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=902</guid>
		<description><![CDATA[1、open 是系统调用 返回的是文件句柄，文件的句柄是文件在文件描述副表里的索引，fopen是C的库函数，返回的是一个指向文件结构的指针。 2、fopen的实现要调用open， 关键看你想返回什么了， FILE指针还是描述符？ 3、32位环境下，编译加“-D_FILE_OFFSET_BITS=64” 要在open里加O_LARGEFILE标记 static int ext2_open_file (struct inode * inode, struct file * filp) { if&#160;(!(filp-&#62;f_flags &#38; O_LARGEFILE) &#38;&#38; &#160; &#160; &#160;&#160; inode-&#62;i_size &#62; 0x7FFFFFFFLL) return -EFBIG; return&#160;0; } 0x7FFFFFFF就是2G-1。 看一下这个逻辑， 就知道open时必须制定O_LARGEFILE. 4、fopen一个文件,fclose两次,会是什么样的情况? 测试了一下: 在aix,hp,sco,unixware上fclose第一次成功,fclose第二次返回错误 在linux上.fclose第一次成功,第二次报segmentation fault,程序段错误 5、计算机语言遵循的规范称为标准。C语言有C标准，C++语言有C++标准。标准中详细规定了你能够做什么和不能做什么。标准中规定不能做的就是我说的标准的禁止事项。 其实不只是标准，在介绍学习或使用语言的书中也会出现大量的应该做和不应该做的说明，只是一般不可能象标准那样全面。所以，在“The C Programming Language”中没有提到这个未定义行为也没有什么奇怪的。 “程序员基本职责”？……　可以认为是为了实现程序预定的目的，对程序员的基本要求。在使用语言上的一个基本要求就是要符合标准规定。 >> 还有一个问题 >> 在非linux系统下,我使用fopen打开的文件 >> 使用close关闭(注意,不是fclose),缓冲也相应关闭; >> [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/902.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

