[Bioperl-l] Permission denied when using Bio::SearchIO in CGI script

Jason Stajich jason@cgt.mc.duke.edu
Fri Jan 24 17:55:11 EST 2003


It is the Operating System not perl that is caring about permissions.
Assuming you are running under UN*X OS, you need to either change the
permissions on the file to world readable (chmod a+r
/home/marchus/filename) or move the file to a place that is readable by
the UID of the webserver (/var/www/html/testfiles/filename).

Read up on file permissions some first to get your bearings if this seems
arcane.

Also - consider how you will be producing the blast reports on the server
and where they will be create so that permissions are correct.

-jason


On Fri, 24 Jan 2003, Marcus Claesson wrote:

> Hello,
>
> I want to use Bioperl's blast parser as an cgi script but have run into
> some problems. There is no problem for my cgi script to open and read
> files in my home directory using the classic:
>
> open(OUT,">/home/marcus/file");
>
> But when opening a blast output in the same place using:
>
> use Bio::SearchIO;
> $in = new Bio::SearchIO(-format => 'blast',
>  -file => '/home/marcus/file');
> I get following permission denied message:
> ------------- EXCEPTION -------------
> MSG: Could not open
> /home/marcus/file for reading:
> Permission denied
> STACK Bio::Root::IO::_initialize_io
> /usr/lib/perl5/site_perl/5.8.0/Bio/Root/IO.pm:244
> STACK Bio::Root::IO::new /usr/lib/perl5/site_perl/5.8.0/Bio/Root/IO.pm:192
> STACK Bio::SearchIO::new
> /usr/lib/perl5/site_perl/5.8.0/Bio/SearchIO.pm:121
> STACK Bio::SearchIO::blast::new
> /usr/lib/perl5/site_perl/5.8.0/Bio/SearchIO/blast.pm:200
> STACK Bio::SearchIO::new
> /usr/lib/perl5/site_perl/5.8.0/Bio/SearchIO.pm:134
> STACK toplevel /var/www/cgi-bin/bxbrowser1.pl:15
>
> Since people on the web will be opening their own files this can be
> problem. Thus, how can I tell Bio::Search to 'not care' about the
> permissions, or just change them?
>
> Really grateful for any help!
> Marcus
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu



More information about the Bioperl-l mailing list