<?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>EmbLogic &#187; Supreet Kaur</title>
	<atom:link href="https://www.emblogic.com/blog/author/kaursupreet48/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Diffrence between stat,fstat and lstat</title>
		<link>https://www.emblogic.com/blog/12/diffrence-between-statfstat-and-lstat/</link>
		<comments>https://www.emblogic.com/blog/12/diffrence-between-statfstat-and-lstat/#comments</comments>
		<pubDate>Fri, 09 Dec 2016 12:29:48 +0000</pubDate>
		<dc:creator><![CDATA[Supreet Kaur]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=13754</guid>
		<description><![CDATA[DESCRIPTION These functions return information about a file. No permissions are required on the file itself, but — in the case of stat() and lstat() — execute (search) permission is required on all of the directories in path that lead &#8230; <a href="https://www.emblogic.com/blog/12/diffrence-between-statfstat-and-lstat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h1 class="manpages">DESCRIPTION</h1>
<p>These functions return information about a file. No permissions are required on the file itself, but — in the case of <b>stat</b>() and <b>lstat</b>() — execute (search) permission is required on all of the directories in <i>path</i> that lead to the file.</p>
<p><b>stat</b>() stats the file pointed to by <i>path</i> and fills in <i>buf</i>.</p>
<p><b>lstat</b>() is identical to <b>stat</b>(), except that if <i>path</i> is a symbolic link, then the link itself is stat-ed, not the file that it refers to.</p>
<p><b>fstat</b>() is identical to <b>stat</b>(), except that the file to be stat-ed is specified by the file descriptor <i>filedes</i>.</p>
<p>All of these system calls return a <i>stat</i> structure, which contains the following fields:</p>
<p>&nbsp;</p>
<table class="src" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td>
<pre>struct stat {
    dev_t     st_dev;     /* ID of device containing file */
    ino_t     st_ino;     /* inode number */
    mode_t    st_mode;    /* protection */
    nlink_t   st_nlink;   /* number of hard links */
    uid_t     st_uid;     /* user ID of owner */
    gid_t     st_gid;     /* group ID of owner */
    dev_t     st_rdev;    /* device ID (if special file) */
    off_t     st_size;    /* total size, in bytes */
    blksize_t st_blksize; /* blocksize for filesystem I/O */
    blkcnt_t  st_blocks;  /* number of blocks allocated */
    time_t    st_atime;   /* time of last access */
    time_t    st_mtime;   /* time of last modification */
    time_t    st_ctime;   /* time of last status change */
};
</pre>
</td>
</tr>
</tbody>
</table>
<p>The <i>st_dev</i> field describes the device on which this file resides.</p>
<p>The <i>st_rdev</i> field describes the device that this file (inode) represents.</p>
<p>The <i>st_size</i> field gives the size of the file (if it is a regular file or a symbolic link) in bytes. The size of a symlink is the length of the pathname it contains, without a trailing null byte.</p>
<p>The <i>st_blocks</i> field indicates the number of blocks allocated to the file, 512-byte units. (This may be smaller than <i>st_size</i>/512, for example, when the file has holes.)</p>
<p>The <i>st_blksize</i> field gives the &#8220;preferred&#8221; blocksize for efficient file system I/O. (Writing to a file in smaller chunks may cause an inefficient read-modify-rewrite.)</p>
<p>Not all of the Linux files systems implement all of the time fields. Some file system types allow mounting in such a way that file accesses do not cause an update of the <i>st_atime</i> field.</p>
<p>The field <i>st_atime</i> is changed by file accesses, e.g. by <b>execve</b>(2), <b>mknod</b>(2), <b>pipe</b>(2), <b>utime</b>(2) and <b>read</b>(2) (of more than zero bytes). Other routines, like <b>mmap</b>(2), may or may not update <i>st_atime</i>.</p>
<p>The field <i>st_mtime</i> is changed by file modifications, e.g. by <b>mknod</b>(2), <b>truncate</b>(2), <b>utime</b>(2) and <b>write</b>(2) (of more than zero bytes). Moreover, <i>st_mtime</i> of a directory is changed by the creation or deletion of files in that directory. The <i>st_mtime</i> field is <i>not</i> changed for changes in owner, group, hard link count, or mode.</p>
<p>The field <i>st_ctime</i> is changed by writing or by setting inode information (i.e., owner, group, link count, mode, etc.).</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/diffrence-between-statfstat-and-lstat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
