freelanceprogrammers.org Forum Index » Perl

creating a new directory/files with perl


View user's profile Post To page top
linuxtyro Posted: Mon Jun 21, 2004 9:10 pm


Joined: 05 Jun 2004

Posts: 2
creating a new directory/files with perl
I have a perl script that is run in the cgi-bin
directory. This script belongs to the group xxx.I want
it to create a new directory in another location(not
cgi-bin)say ../../anotherdir, that has write and
execute permissions for group. That is, permissions
for anotherdir is

drwxrwxr-x 17 arnold xxx 1024 Jun 21 09:24
anotherdir

I do a system(mkdir `full/path/to/anotherdir/newdir`)
in my perl script.However it gives me a permission
denied error when it tries to create the directory.
Shouldnt my script work as it belongs to the same
group(xxx) as anotherdir? Is there another way to do
this?

thanks for any help

RS.



__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
Reply with quote
Send private message
View user's profile Post To page top
slackusr Posted: Wed Jun 23, 2004 2:34 am


Joined: 23 Jun 2004

Posts: 2
creating a new directory/files with perl
do you have permission to write in the directory in which you`re
making the directory?

--- In perl_official@yahoogroups.com, LinuxTyro <linuxtyro@y...>
wrote:
> I have a perl script that is run in the cgi-bin
> directory. This script belongs to the group xxx.I want
> it to create a new directory in another location(not
> cgi-bin)say ../../anotherdir, that has write and
> execute permissions for group. That is, permissions
> for anotherdir is
>
> drwxrwxr-x 17 arnold xxx 1024 Jun 21 09:24
> anotherdir
>
> I do a system(mkdir `full/path/to/anotherdir/newdir`)
> in my perl script.However it gives me a permission
> denied error when it tries to create the directory.
> Shouldnt my script work as it belongs to the same
> group(xxx) as anotherdir? Is there another way to do
> this?
>
> thanks for any help
>
> RS.
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail
Reply with quote
Send private message
View user's profile Post To page top
perl_jam03 Posted: Wed Jun 23, 2004 3:27 am


Joined: 05 May 2004

Posts: 16
creating a new directory/files with perl
Do a `ps aux` on the command line to find out who is runnign apache.
Look for httpd or apache. A grep might be helpful:

$ ps aux | grep httpd

The user is probably `nobody`, which will not have access to that
directory. Be very careful what kind of access you grant to `nobody`,
since it may give a breach in security.

Rex

--- slackusr <no_reply@yahoogroups.com> wrote:
> do you have permission to write in the directory in which you`re
> making the directory?
>
> --- In perl_official@yahoogroups.com, LinuxTyro <linuxtyro@y...>
> wrote:
> > I have a perl script that is run in the cgi-bin
> > directory. This script belongs to the group xxx.I want
> > it to create a new directory in another location(not
> > cgi-bin)say ../../anotherdir, that has write and
> > execute permissions for group. That is, permissions
> > for anotherdir is
> >
> > drwxrwxr-x 17 arnold xxx 1024 Jun 21 09:24
> > anotherdir
> >
> > I do a system(mkdir `full/path/to/anotherdir/newdir`)
> > in my perl script.However it gives me a permission
> > denied error when it tries to create the directory.
> > Shouldnt my script work as it belongs to the same
> > group(xxx) as anotherdir? Is there another way to do
> > this?
> >
> > thanks for any help
> >
> > RS.
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > New and Improved Yahoo! Mail - Send 10MB messages!
> > http://promotions.yahoo.com/new_mail
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Yahoo! Domains - Claim yours for only $14.70
> http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/ndFolB/TM
>
--------------------------------------------------------------------~->
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help