C
cyrusgreats
I have gui page that reads a list of directory and print directories
(just names not full path) into scrolling_list on the gui page than
from there I choose the dir/name and want to copy the directory to the
other page. The problem I ran into problem, some of the directories
have space between like "I am a dirtectory, when I want to copy the
directory it can't find the orign of dir, any idea how to get around
this...thanks in advance..
Here is a code to read directory and copy ones!
$orign = "../origin/";
$target = ''../target/";
opendir(DIR, $orign) or die "$!";
opendir(SUB, $target) or die "$!"; # here in this dir there many
dirctories some of or space or special chrac between
foreach $dir (@DIR) {
opendir(R, $orign);
@subdir = grep(/^i/, sort readdir(SUB));
}
# here print those files from @subdir to the gui/page
# user select one of the dir or name (may have space between)
# copy the name/dir to other location
$copy = $MYDATA{copy};
$target = ''../target/$copy";
`cp -R -f $orig $target`;
# here I'm getting error "No such file or directory"
# due to the space betwwen target
(just names not full path) into scrolling_list on the gui page than
from there I choose the dir/name and want to copy the directory to the
other page. The problem I ran into problem, some of the directories
have space between like "I am a dirtectory, when I want to copy the
directory it can't find the orign of dir, any idea how to get around
this...thanks in advance..
Here is a code to read directory and copy ones!
$orign = "../origin/";
$target = ''../target/";
opendir(DIR, $orign) or die "$!";
opendir(SUB, $target) or die "$!"; # here in this dir there many
dirctories some of or space or special chrac between
foreach $dir (@DIR) {
opendir(R, $orign);
@subdir = grep(/^i/, sort readdir(SUB));
}
# here print those files from @subdir to the gui/page
# user select one of the dir or name (may have space between)
# copy the name/dir to other location
$copy = $MYDATA{copy};
$target = ''../target/$copy";
`cp -R -f $orig $target`;
# here I'm getting error "No such file or directory"
# due to the space betwwen target