You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by "Cameron B. Prince" <cp...@rideware.com> on 2003/07/14 17:41:40 UTC

Cwd / chdir

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


Re: Cwd / chdir

Posted by Gerald Richter <ri...@ecos.de>.
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
>

Looks like the user Apache is running as don't have enough permissions to
access the directory.

It has nothing to do with Safe or Opcodes

Gerald



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


Re: Cwd / chdir

Posted by ck...@eplsite.org.
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