½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
asp
CSS
html
mysql
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 83 | Á¶È¸¼ö 1,407 | µî·ÏÀÏ 2003-11-06 13:05:19

´Ð³×ÀÓ

sunny97

À̸ÞÀÏ

orange123@orgio.net

Á¦¸ñ

[´äº¯] mkdir µð·ºÅ丮 ¸¸µé±â
³»¿ë

´äº¯ °¨»çÇÕ´Ï´Ù. ±×·¡¼­. Á¦°¡ ¼­ºêÇÔ¼ö¸¦ ¸¸µé¾ú°Åµç¿ä.

Á¦°¡ ¼­ºê·çƾÇÔ¼ö¸¦ ¸¸µé¾î¼­.. foreach¹®¾È¿¡¼­ µ¹¸±·Á°í Çϰŵç¿ä.. -_-;

¾Æ·¡Ã³·³ ¸¸µé¾ú´Âµ¥¿ä..

>> °æ»óºÏµµ (/output/0) <<
Æ÷Ç׽à (/output/0/2)

>> ÀÎõ±¤¿ª½Ã (/output/3) <<
cannot mkdir File exists at try.pl line 102.

 

ÀÌ·¸°Ô Áß°£¿¡ ¸¸µé´Ù°¡ °è¼Ó °°Àº°Í¸¸ ¸¸µé´Ù ²÷°Ü¹ö·Á¿ä

¾î¶»°Ô ÇؾßÇϳª¿ä? mkdir() ÇÔ¼ö°¡ ¹®Á¦ÀÎÁö.. ¾Æ´Ï¸é È£ÃâÇÏ´Â °÷ÀÌ ¹®Á¦ÀÎÁö ¸ð¸£°Ú½À´Ï´Ù.

¾î¶»°Ô ¼öÁ¤ÇÏ¸é  ÁÁÀ»±î¿©?

my %all = ();

open (fp, "data.txt");
while (<fp>) {
    chomp;
    s/^\s*"//g;
    s/"\s*$//g;
    s/\s*"\s*,\s*"\s*/","/g;
    @arr = split( /","/,$_);
    $all{ $arr[6] }{ $arr[7] }{ $arr[8] } = 1;

 }

close fp;

my %dir = ();
my $count = 0;


my %addr1 = ();

#print ">>Top (output/) <<\n";
foreach $k1 ( keys %all )
{
        $addr1{$k1} = 1;
        $dir{ $k1 } = $count++;


        my %addr2 = ();
        $sub1 = $all{$k1};
        
        #print ">> $k1 (/output/$dir{$k1}) <<\n";
        foreach $k2 ( keys %$sub1 )
        {
            $addr2{$k2} = 1;
            $dir{ $k2 } =$count++;

            my %addr3 = ();
            $sub2 = $sub1->{$k2};
   
            makedir();


            #print ">> $k1 > $k2 (/output/$dir{$k1}/$dir{$k2}) <<\n";
            foreach $k3 ( keys %$sub2 )
            {
                $dir{ $k2 } = $count++    ;
                        $addr3{$k3} = 1  ;


            #print "$k3 (/search?addr1=$k1&addr2=$k2&addr3=$k3)";
            $dir2= $dir{$k2};
            $dir1= $dir{$k1};
            #   makedir ();

 

            }

            # print "\n\n";


            #print "$k2 (/output/$dir{$k1}/$dir{$k2})";


            #open ( fp, ">$dir{$k1}") || die "failed opening. \n";
            #foreach $k2 ( keys %$sub1){
            #print fp <<END_HTML;
#<a href =$dir{$k2}> $k2 </a><br>
#END_HTML
#           }
#           close fp;


       }

       # print "\n\n";

#print "$k1 (/output/$dir{$k1})\n";

#foreach $k1 (keys %all){

open ( fp, ">index.htm") || die "failed opening.\n";

foreach $k1 (keys %all){
print fp <<END_HTML;       
<a href =$dir{$k1}/index.htm> $k1 </a><br>
END_HTML
}


close fp;


}

sub makedir {


        mkdir ("$dir1",0777) || die "cannot mkdir $!";
}

Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û mkdir µð·ºÅ丮 ¸¸µé±â 2003-11-06 10:17:16
´ÙÀ½°Ô½Ã±Û list box¸¦ ÀÌ¿ëÇؼ­ textarea ¿­±â 2003-11-06 14:33:27