Date: Monday January 20, 2020 @ 06:50 Author: argrath Update of /cvsroot/perldocjp/docs/modules/File-Temp-0.22 In directory sf-cvs:/tmp/cvs-serv126091/modules/File-Temp-0.22 Modified Files: Temp.pod Log Message: in progress =================================================================== File: Temp.pod Status: Up-to-date Working revision: 1.3 Sun Jan 19 21:50:43 2020 Repository revision: 1.3 /cvsroot/perldocjp/docs/modules/File-Temp-0.22/Temp.pod,v Existing Tags: No Tags Exist -------------- next part -------------- Index: docs/modules/File-Temp-0.22/Temp.pod diff -u docs/modules/File-Temp-0.22/Temp.pod:1.2 docs/modules/File-Temp-0.22/Temp.pod:1.3 --- docs/modules/File-Temp-0.22/Temp.pod:1.2 Wed Mar 6 06:02:19 2019 +++ docs/modules/File-Temp-0.22/Temp.pod Mon Jan 20 06:50:43 2020 @@ -43,8 +43,8 @@ ¤³¤Î¥â¥¸¥å¡¼¥ë¤Ï¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ò¤Þ¤¿¤¤¤Ç°Ü¿¢¤Ç¤¤ë¤è¤¦¤Ë À߷פµ¤ì¤Æ¤ª¤ê¡¢ -¸½ºß¡¢Unix¡¢VMS¡¢DOS¡¢OS/2¡¢Windows, Mac OS (Classic) ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡£ -¿·¤·¤¤OS¤Ë°Ü¿¢¤¹¤ë¤È¤¤Ë¤Ï¡¢°ìÈÌŪ¤Ë¡¢»°¤Ä¤Î²ò·è¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ +¸½ºß¡¢Unix, VMS, DOS, OS/2, Windows, Mac OS (Classic) ¤ËÂбþ¤·¤Æ¤¤¤Þ¤¹¡£ +¿·¤·¤¤ OS ¤Ë°Ü¿¢¤¹¤ë¤È¤¤Ë¤Ï¡¢°ìÈÌŪ¤Ë¡¢»°¤Ä¤Î²ò·è¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ ¼çÍפÊÌäÂ꤬¤¢¤ê¤Þ¤¹: =over 4 @@ -58,8 +58,8 @@ =end original -¤½¤ÎOS¤Ï¡¢³«¤¤¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤òºï½ü¤Ç¤¤Þ¤¹¤«¡© -¤â¤·¤Ç¤¤Ê¤±¤ì¤Ð¡¢C<_can_unlink_opend_file>¥á¥½¥Ã¥É¤Ï½¤Àµ¤µ¤ì¤ë¤Ù¤¤Ç¤¹¡£ +¤½¤Î OS ¤Ï¡¢³«¤¤¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤òºï½ü¤Ç¤¤Þ¤¹¤«¡© +¤â¤·¤Ç¤¤Ê¤±¤ì¤Ð¡¢C<_can_unlink_opend_file> ¥á¥½¥Ã¥É¤Ï½¤Àµ¤µ¤ì¤ë¤Ù¤¤Ç¤¹¡£ =item * @@ -205,7 +205,7 @@ C<File::Temp> ¤Ï¡¢°ÂÁ´¤ÊÊýË¡¤Ç¡¢°ì»þ¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¡¢³«¤¯¤Î¤Ë»È¤¨¤Þ¤¹¡£ ´Ø¿ô¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎξÊý¤¬¤¢¤ê¤Þ¤¹¡£ -The File::Temp ¤Î¥³¥ó¥¹¥È¥é¥¯¥¿¤È tempfile() ´Ø¿ô¤Ï¡¢°ì»þ¥Õ¥¡¥¤¥ë¤Î̾Á°¤ª¤è¤Ó +File::Temp ¤Î¥³¥ó¥¹¥È¥é¥¯¥¿¤È tempfile() ´Ø¿ô¤Ï¡¢°ì»þ¥Õ¥¡¥¤¥ë¤Î̾Á°¤ª¤è¤Ó ³«¤¤¤¿¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤òÊÖ¤¹¤Î¤Ë»È¤ï¤ì¤Þ¤¹¡£ tempdir() ´Ø¿ô¤Ï¡¢°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¤Î¤Ë»È¤ï¤ì¤Þ¤¹¡£ @@ -405,7 +405,6 @@ =end original -Supports the same options as the C<tempdir> ´Ø¿ô¤ÈƱ¤¸¥ª¥×¥·¥ç¥ó¤ËÂбþ¤·¤Æ¤¤¤Þ¤¹¡£ ¤³¤Î¥á¥½¥Ã¥É¤Çºî¤é¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç CLEANUP => 1 ¤Ë¤Ê¤ë¤³¤È¤Ë Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ @@ -644,10 +643,9 @@ =end original -Equivalent to specifying a DIR of "File::Spec->tmpdir", writing the file -into the same temporary directory as would be used if no template was -specified at all. -(TBT) +DIR ¤Ë "File::Spec->tmpdir" ¤ò»ØÄꤷ¤¿¤Î¤ÈÅù²Á¤Ç¡¢ +¥Æ¥ó¥×¥ì¡¼¥È¤¬Á´¤¯»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë»È¤ï¤ì¤ëƱ¤¸°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤Ë +¥Õ¥¡¥¤¥ë¤ò½ñ¤¹þ¤ß¤Þ¤¹¡£ ($fh, $filename) = tempfile($template, UNLINK => 1); @@ -757,13 +755,15 @@ =end original -If the operating system supports it (for example BSD derived systems), the -filehandle will be opened with O_EXLOCK (open with exclusive file lock). -This can sometimes cause problems if the intention is to pass the filename -to another system that expects to take an exclusive lock itself (such as -DBD::SQLite) whilst ensuring that the tempfile is not reused. In this -situation the "EXLOCK" option can be passed to tempfile. By default EXLOCK -will be true (this retains compatibility with earlier releases). +(Î㤨¤Ð BSD ÇÉÀ¸¤Î¥·¥¹¥Æ¥à¤Î¤è¤¦¤Ë)¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤¬ +¤³¤ì¤ËÂбþ¤·¤Æ¤¤¤ë¤Ê¤é¡¢ +¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Ï O_EXLOCK (ÇÓ¾¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤Ç³«¤¯) ¤Ç³«¤«¤ì¤Þ¤¹¡£ +This can sometimes cause problems +if the intention is to pass the filename +to another system that expects to take an exclusive lock itself +(such as DBD::SQLite) whilst ensuring that the tempfile is not reused. +¤³¤Î¾ì¹ç¡¢"EXLOCK" ¥ª¥×¥·¥ç¥ó¤ò tempfile ¤ËÅϤ»¤Þ¤¹¡£ +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï EXLOCK ¤Ï¿¿¤Ç¤¹ (¤³¤ì¤Ï°ÊÁ°¤Î¥ê¥ê¡¼¥¹¤È¤Î¸ß´¹À¤ò°Ý»ý¤·¤Þ¤¹)¡£ (TBT) ($fh, $filename) = tempfile($template, EXLOCK => 0); @@ -774,7 +774,7 @@ =end original -¥ª¥×¥·¥ç¥ó¤Ï¡¢É¬Íפ˱þ¤¸¤Æ¡¢ÁȤ߹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ +¥ª¥×¥·¥ç¥ó¤ÏɬÍפ˱þ¤¸¤ÆÁȤ߹ç¤ï¤»¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ =begin original @@ -802,11 +802,12 @@ =end original ¤³¤ì¤Ï¡¢°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¤¿¤á¤Î¿ä¾©¤µ¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¹¡£ -By default the directory will not be removed on exit -(that is, it won't be temporary; this behaviour can not be changed -because of issues with backwards compatibility). To enable removal -either use the CLEANUP option which will trigger removal on program -exit, or consider using the "newdir" method in the object interface which +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ï½ªÎ»»þ¤Ëºï½ü¤µ¤ì¤Þ¤»¤ó +(¤Ä¤Þ¤ê¡¢¤³¤ì¤Ï°ì»þŪ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó; ¤³¤Î¿¶¤ëÉñ¤¤¤Ï²áµî¸ß´¹ÀÌäÂê¤Ë¤è¤ê +Êѹ¹¤Ç¤¤Þ¤»¤ó)¡£ +ºï½ü¤ò͸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢ +¥×¥í¥°¥é¥à½ªÎ»»þ¤Ëºï½ü¤ò¹Ô¤¦ CLEANUP ¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤«¡¢ +or consider using the "newdir" method in the object interface which will allow the directory to be cleaned up when the object goes out of scope. (TBT) @@ -817,7 +818,7 @@ =end original -¤³¤Î´Ø¿ô¤Î¿¶Éñ¤Ï°ú¿ô¤Ë¤è¤ê¤Þ¤¹: +¤³¤Î´Ø¿ô¤Î¿¶¤ëÉñ¤¤¤Ï°ú¿ô¤Ë¤è¤ê¤Þ¤¹: $tempdir = tempdir(); @@ -1094,8 +1095,8 @@ =end original -ÂÅÅö¤Ê°ì»þ¥Õ¥¡¥¤¥ë̾¤òÊÖ¤·¤Þ¤¹¡£ -¤Ç¤¹¤¬¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬¡¢Â¾¤Î狼¤Ë³«¤«¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ÏÊݾڤ·¤Þ¤»¤ó¡£ +ÂÅÅö¤Ê°ì»þ¥Õ¥¡¥¤¥ë̾¤òÊÖ¤·¤Þ¤¹¤¬¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬Â¾¤Î狼¤Ë +³«¤«¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ÏÊݾڤ·¤Þ¤»¤ó¡£ $unopened_file = mktemp($template); @@ -1150,8 +1151,8 @@ ¥·¥¹¥Æ¥àÆâÉô¤Î¥Õ¥¡¥¤¥ë (C<P_tmpdir>) ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ ñ½ã¤Ë¡¢L<File::Spec|File::Spec> ¤Ë¤è¤Ã¤Æ¡¢tmpdir() ¤¬ÊÖ¤¹¤â¤Î¤ÎÁªÂò¤Ë °Í¤Ã¤Æ¤¤¤Þ¤¹¡£ -¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¾ì½ê¤Ï¡¢C<TMPDIR> ´Ä¶ÊÑ¿ô¤ò»È¤Ã¤Æ -ÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡¢¤³¤ì¤Ï°ÂÁ´¤Ç¤Ï¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£ +¼ÂÁõ¤Ë¤è¤Ã¤Æ¤Ï¡¢¤³¤Î¾ì½ê¤Ï¡¢°ÂÁ´¤Ç¤Ï¤Ê¤¤¤«¤â¤·¤ì¤Ê¤¤ C<TMPDIR> ´Ä¶ÊÑ¿ô¤ò +»È¤Ã¤ÆÀßÄꤵ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ ¤³¤Î¤³¤È¤¬ÌäÂê¤Ê¤é¡¢Ã±½ã¤Ë¡¢mkstemp() ¤ò»È¤¤¡¢¥Æ¥ó¥×¥ì¡¼¥È¤ò»ØÄꤷ¤Æ²¼¤µ¤¤¡£ =over 4 @@ -1446,9 +1447,9 @@ =end original -ºÇ¸å¤Ë¡¢NFS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢ ¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Î¥ê¥ó¥¯¥«¥¦¥ó¥È¤Ï¡¢ -ºï½ü¤Î¸å¡¢¤¹¤°¤Ë¤Ï¡¢¾ï¤Ë¤Ï 0 ¤Ë¤Ê¤ê¤Þ¤»¤ó¡£ -¸½ºß¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢NFS ¥Ç¥£¥¹¥¯¾å¤Ç¤Ï¼ºÇÔ¤¹¤ë¤ÈÁÛÄꤵ¤ì¤Þ¤¹¡£ +ºÇ¸å¤Ë¡¢NFS ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Î¥ê¥ó¥¯¥«¥¦¥ó¥È¤Ï¡¢ +¾ï¤Ëºï½ü¤Îľ¸å¤Ë 0 ¤Ë¤Ê¤ë¤È¤Ï¸Â¤ê¤Þ¤»¤ó¡£ +¸½ºß¤Î¤È¤³¤í¡¢¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢NFS ¥Ç¥£¥¹¥¯¾å¤Ç¤Ï¼ºÇÔ¤¹¤ë¤ÈÁÛÄꤵ¤ì¤Þ¤¹¡£ =begin original @@ -1458,9 +1459,9 @@ =end original -¤³¤Î´Ø¿ô¤Ï¡¢¥°¥í¡¼¥Ð¥ëÊÑ¿ô $KEEP_ALL ¤¬¿¿¤Ç¡¢³«¤¤¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î -unlink ¤ËÂбþ¤·¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï̵¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£ -unlink ¤¬ END ¥Ö¥í¥Ã¥¯¤Þ¤ÇÃٱ䤵¤ì¤ë¾ì¹ç¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï +¥°¥í¡¼¥Ð¥ëÊÑ¿ô $KEEP_ALL ¤¬¿¿¤Ç¡¢³«¤¤¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î +ºï½ü¤ËÂбþ¤·¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤Î´Ø¿ô¤Ï̵¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£ +ºï½ü¤¬ END ¥Ö¥í¥Ã¥¯¤Þ¤ÇÃٱ䤵¤ì¤ë¾ì¹ç¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ï ºï½ü¤Î¤¿¤á¤ËÅÐÏ¿¤µ¤ì¤¿¤Þ¤Þ¤Ç¤¹¡£ =begin original @@ -1471,10 +1472,9 @@ =end original -This function should not be called if you are using the object oriented -interface since the it will interfere with the object destructor deleting -the file. -(TBT) +¤³¤Î´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¥Ç¥¹¥È¥é¥¯¥¿¤ò˸³²¤¹¤ë¤Î¤Ç¡¢ +¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¤³¤Î´Ø¿ô¤Ï +¸Æ¤Ó½Ð¤µ¤ì¤ë¤Ù¤¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ =cut @@ -1489,10 +1489,10 @@ =end original -Compare C<stat> of filehandle with C<stat> of provided filename. This -can be used to check that the filename and filehandle initially point -to the same file and that the number of links to the file is 1 (all -fields returned by stat() are compared). +¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Î C<stat> ¤ò¡¢»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤Î C<stat> ¤ÈÈæ³Ó¤·¤Þ¤¹¡£ +This can be used to check that the filename and filehandle initially point +to the same file and that the number of links to the file is 1 +(stat() ¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬Èæ³Ó¤µ¤ì¤Þ¤¹)¡£ (TBT) cmpstat($fh, $path) @@ -1505,9 +1505,8 @@ =end original -Returns false if the stat information differs or if the link count is -greater than 1. Calls croak if there is a security anomaly. -(TBT) +stat ¾ðÊ󤬰ۤʤ뤫¡¢¥ê¥ó¥¯¥«¥¦¥ó¥È¤¬ 1 ¤è¤êÂ礤¤¾ì¹ç¤Ï¡¢µ¶¤òÊÖ¤·¤Þ¤¹¡£ +¥»¥¥å¥ê¥Æ¥£¾å¤Î°Û¾ï¤¬¤¢¤ë¤È croak ¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£ =begin original @@ -1521,8 +1520,9 @@ =end original -On certain platforms, for example Windows, not all the fields returned by stat() -can be compared. For example, the C<dev> and C<rdev> fields seem to be +Î㤨¤Ð Windows ¤Î¤è¤¦¤Ê¡¢°ìÉô¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï¡¢ +stat() ¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤òÈæ³Ó¤¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£ +For example, the C<dev> and C<rdev> fields seem to be different in Windows. Also, it seems that the size of the file returned by stat() does not always agree, with C<stat(FH)> being more accurate than C<stat(filename)>, presumably because of caching issues @@ -1552,9 +1552,9 @@ =end original -Similar to C<unlink0> except after file comparison using cmpstat, the -filehandle is closed prior to attempting to unlink the file. This -allows the file to be removed without using an END block, but does +C<unlink0> ¤ÈƱÍͤǤ¹¤¬¡¢cmpstat ¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¤òÈæ³Ó¤·¤¿¸å¡¢ +¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤è¤¦¤È¤¹¤ëÁ°¤Ë¥Õ¥¡¥¤¥ë¤òÊĤ¸¤Þ¤¹¡£ +This allows the file to be removed without using an END block, but does mean that the post-unlink comparison of the filehandle state provided by C<unlink0> is not available. (TBT) @@ -1611,8 +1611,9 @@ =end original -Calling this function will cause any temp files or temp directories -that are registered for removal to be removed. This happens automatically +¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤È¡¢ºï½ü¤¹¤ë¤ÈÅÐÏ¿¤µ¤ì¤¿Á´¤Æ¤Î°ì»þ¥Õ¥¡¥¤¥ë¤ä +°ì»þ¥Ç¥£¥ì¥¯¥È¥ê¤¬ºï½ü¤µ¤ì¤Þ¤¹¡£ +This happens automatically when the process exits but can be triggered manually if the caller is sure that none of the temp files are required. This method can be registered as an Apache callback. @@ -1885,8 +1886,8 @@ Controls whether temporary files and directories should be retained regardless of any instructions in the program to remove them -automatically. This is useful for debugging but should not be used in -production code. +automatically. +¤³¤ì¤Ï¥Ç¥Ð¥Ã¥°¤Ë¤ÏÍÍѤǤ¹¤¬¡¢ËÜÈÖ¥³¡¼¥É¤ÇÍѤ¤¤ë¤Ù¤¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ (TBT) $File::Temp::KEEP_ALL = 1; @@ -2037,12 +2038,10 @@ =end original -If you are forking many processes in parallel that are all creating -temporary files, you may need to reset the random number seed using -srand(EXPR) in each child else all the children will attempt to walk -through the same set of random file names and may well cause -themselves to give up if they exceed the number of retry attempts. -(TBT) +¤â¤·¤½¤ì¤¾¤ì¤¬°ì»þ¥Õ¥¡¥¤¥ë¤òºî¤ë¿¤¯¤Î¥×¥í¥»¥¹¤òÊ¿¹Ô¤Ë fork ¤¹¤ë¤Ê¤é¡¢ +¤½¤ì¤¾¤ì¤Î»Ò¤Ç srand(EXPR) ¤ò»È¤¦¤³¤È¤ÇÍð¿ô¤Î¼ï¤ò¥ê¥»¥Ã¥È¤¹¤ëɬÍפ¬ +¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó; ¤µ¤â¤Ê¤±¤ì¤ÐÁ´¤Æ¤Î»Ò¤¬Æ±¤¸¥é¥ó¥À¥à¥Õ¥¡¥¤¥ë̾¤Î +½¸¹ç¤òÄ̲ᤷ¤è¤¦¤È¤·¤Æ¡¢ºÆ»î¹Ô²ó¿ô¤òĶ¤¨¤ë¤ÈÄü¤á¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£ =head2 Directory removal