<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; Системный вызов open() close()]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=39072&amp;type=atom" />
	<updated>2017-05-16T12:53:53Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=39072</id>
		<entry>
			<title type="html"><![CDATA[Re: Системный вызов open() close()]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=455170#p455170" />
			<content type="html"><![CDATA[<p>Сделай цикл.</p>]]></content>
			<author>
				<name><![CDATA[Vascom]]></name>
				<uri>https://linuxforum.ru/profile.php?id=5339</uri>
			</author>
			<updated>2017-05-16T12:53:53Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=455170#p455170</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Системный вызов open() close()]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=455168#p455168" />
			<content type="html"><![CDATA[<p>Создать процесс, создающий 4 файла A, B, C D, отрывающий и закрывающий их следующим образом:</p><p>Открыть А, закрыть А; откр. B, закр. B; откр. C, закр. C; откр. D, закр. D.</p><p>это мой прог<br /></p><div class="codebox"><pre><code>#include &lt;sys/types.h&gt;

#include &lt;sys/stat.h&gt;

#include &lt;fcntl.h&gt;

#include &lt;unistd.h&gt;

#include &lt;stdlib.h&gt;

#include &lt;stdio.h&gt; int main(void) {

int fd_a;

int fd_b;

int fd_c;

int fd_d;

fd_a = open(«baobab.txt», O_CREAT | O_RDWR , 0664);

if(fd_a == -1) {

perror(«open»);

exit(EXIT_FAILURE);

}

close(fd_a);

if(fd_a == -1) {

perror(«close»);

exit(EXIT_FAILURE);

}

...

exit(EXIT_SUCCESS);

}</code></pre></div><p>прога&nbsp; рабочая.</p><p>Мне кажется ,что мой прог слишком длинная если я буду для каждаго файла писать.</p><p>Нелзя ли сделать ее по короче?</p>]]></content>
			<author>
				<name><![CDATA[trung.bui]]></name>
				<uri>https://linuxforum.ru/profile.php?id=40904</uri>
			</author>
			<updated>2017-05-16T12:29:44Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=455168#p455168</id>
		</entry>
</feed>
