ÔØ×Ô"Advanced Linux Programming" By Mark Mitchell, Jeffrey Oldham, Alex Samuel.
ÓÐÁ½ÖÖ·½·¨£º
1£©Ê¹Óà mkstemp¡£Ê¹Óøú¯ÊýʱÎļþÃûÐèÒªÓиöÒÔÁù¸öX½áβµÄÃüÃûÄ£°å£¬ÀýÈçchar temp_filename[] = "/tmp/temp_file.XXXXXX"¡£ ʹÓÃÕâ¸ö·½·¨£¬ÁÙʱÎļþ²»»á×Ô¶¯É¾³ý¡£¿ÉÒÔµ÷ÓÃunlink()ʹµÃÒýÓüÆÊý¼õÒ»£¬ÕâÑùµ±³ÌÐòÍƳöʱ£¬Îļþ×Ô¶¯É¾³ý¡£
2£©Ê¹ÓÃtmpfile()¡£¸Ãº¯ÊýÒѾÄÚ²¿unlinkÁË£¬ËùÒÔ²»ÓÃÏÔʽ¼õÒ»¼ÆÊýÆ÷¡£
±¸×¢£¬»¹ÓÐmktemp, tmpnamºÍtempnam¡£µ«ÊÇÒòΪ¿É¿¿ÐԺͰ²È«ÐÔ¶ø²»ÍƼöʹÓá£
Ë®ÖÐʯ ÓÚ 2008-03-02 19:56:57·¢±í:
(5ty(
Modegle ÓÚ 2008-02-29 16:06:56·¢±í:
1) ´ÓshellÀïÃæ²é¿´Ç°Ò»´Î³ÌÐòÖ´Ðеķµ»ØÖµ£¨$?£©£º % echo $?¡£ ÀýÈ磬ǰһ´Îµ÷Óóɹ¦£¬Õâ¸öechoÃüÁ·µ»Ø0----linuxϳɹ¦Ê±·µ»Ø0¡£
2) stdout´ø»º´æ£¬ËùÒÔprintf²»Ò»¶¨Á¢Âí´ò³ö£¬µ«ÊÇstderrÊDz»´ø»º´æµÄ