Server for Information Technologies ������ ��������������
������� �������������� ����������
(095) 932-9212, 932-9213, 939-0783
E-mail: [email protected]
������ �������� ����(!) ������������� ���������� CIT Forum CD-ROM

TMPNAM(3S)

��������
tmpnam, tempnam - �������� ���� ��������� ������

���������

	#include <stdio.h>
	
	char *tmpnam (s)
	char *s;
	
	char *tempnam (dir, pfx)
	char *dir, *pfx;

��������
� ������� ���� ������� ��������� �����, ������� ����� ��� �������� ������������ ��� ���������� ��������� ������.

������� tmpnam ������ �������� ��� �����, ��������� ���������� �������, ������������ ���������� P_tmpdir �� ���������� ����� <stdio.h>. ���� ��������� s ������ (����� NULL), �� ������� �������� ��������� �� ���������� ����������� ������� � ���������� ����� ���� �������. ��� ��������� ������ tmpnam ���������� ����������� ������� ���������. ���� s �� ����� NULL, �� ��� �������� ��������������� ��� ����� ������� ����� �� ����� L_tmpnam ����, ��� L_tmpnam - ���������, ������������ � <stdio.h>; ������� �������� ��������� � ���� ������ � ���������� s.

������� tempnam ���� ������������ ����������� �������� �������. �������� dir ��������� �� ��� ��������, � ������� ����� ������� ����. ���� dir ����� NULL ��� ��������� �� ������� ��������, �� ���������� ������ ����������� ��������, �� ��� �������� � �������������� ��������� P_tmpdir. ���� � ���� ������� ����������, � �������� ���������� ����� ����� ����������� /tmp. ��������� ������������������ �������� ������������, ���� ���������� ���������� ��������� TMPDIR; ������ �� �������� ������ ��� �������� ��������� ������.

�� ������ ������� ��������������� ����� ������, ������������ ������������ ������������������� ��������. ��� �������� ����� ���� ������������ �������� pfx. ���� �������� ����� ����� �������� NULL ��� ���� ������� �� ������� ������ �� 5 ��������, ������� ������ �������������� � �������� ������ �������� ����� ���������� �����.

������� tempnam �������� ������� malloc(3C) ��� ��������� ������� ������ ��� �������������� ���, � ���������� ������ �� ��� �������. ����� �������, �������� ���������, ������������� �������� tempnam, ����� ������� ���������� ������� free [��. malloc(3C)]. ���� tempnam �� �����-���� �������� �� ����� ���������� ��������� ��������� (��������, �������� ����������� ������� malloc ��� �� ������� ����� ���������� �������), �� ������������ ������ ���������.

����������
��� ������ ��������� ��� ������� ������� ����� ���.

�����, ��������� � ������� ��������� ������� � ������� fopen(3S) ��� creat(2), �������� ���������� ������ � ��� ������, ��� ��� �������� � ��������, ��������������� ��� ���������� �������������, � �� ����� ���������. ��� �������� ���� ������, ����� � ��� ������ �������������, ������������ ������ ��������� ��������� ����� unlink(2).

��. �����
creat(2), unlink(2), fopen(3S), malloc(3C), mktemp(3C), tmpfile(3S).

�����������
��� ������ ����� 17576 ��� � ����� �������� ��� ������� ������ ���������� �������� ��� ��������� ����� �����.

� ���������� ����� ������������ ����� ����� � ��� ��������� ������ ������� ����� ������� ���� � ��� �� ������. ����� ������� �� ��������, ���� ���������� "������" ������� ������� ���� � ������� ����������� ������� ��� ������� mktemp, � ����� ������ ���������� ���, ����� ������������ �� ������ �������� ���� �������������.
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT