perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ckas...@eplsite.org>
Subject Re: Cwd / chdir
Date Tue, 15 Jul 2003 14:10:43 GMT
Cameron:

In eplsite i use the next routine to get the list of files from a directory:

$langdir ="."; # it means actual directory but you can specify a different
    opendir (LANGUAGEDIR,$langdir) || die "ca not opendir $langdir: $!";
    rewinddir(LANGUAGEDIR);

    @languages = grep { /.epl/ } readdir(LANGUAGEDIR);

    foreach (@languages)
    {
        ($nothing,$lang1) = split('\-',$_);
        ($language,$nothing) = split('\.',$lang1);
        $thelanguages .='<option
value="'.$language.'">'.$language.'</option>';
    }

    closedir(LANGUAGEDIR);


I hope this helps

Carlos Kassab

>
> Hi,
>
> I am trying to use Embperl to scan a directory of files... I call a
> package that uses Cwd and File::Find. It returns the list of files.
> However, when I run it from the Embperl code I get:
>
> [error] [2306]ERR:  24:  Error in Perl code: chdir: Illegal seek
>
> I have read the documentation on Safe and Opcodes... But they are
> confusing to me...
>
> They seem to indicate that in order to define and use optOpcodeMask,
> you must setup a Safe compartment. Am I mistaken, or isn't there
> already a Safe compartment which is preventing chdir from working now?
> How can I allow this function?
>
> Thanks,
> Cameron
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message