Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Opening a dir on another domain

davidrtgdavidrtg Posts: 95Member
I'm trying to run an opendir function on another domains dir.
The following isn't working. Any ideas or can this be done at all?
[code]
opendir(THEDIR,"http://www.thedomain.com/imgblocks");
(@allimgfiles) = readdir THEDIR; closedir THEDIR;
[/code]
When I go to http://www.thedomain.com/imgblocks I get a list of the files in the dir. You don't need any special permissions to view the dir, that I am aware of.

Thanks,
David

Comments

  • JonathanJonathan Posts: 2,914Member
    : I'm trying to run an opendir function on another domains dir.
    Unlikely to work, as it's for stuff accessible through the normal filesystem.

    : The following isn't working. Any ideas or can this be done at all?
    : [code]
    : opendir(THEDIR,"http://www.thedomain.com/imgblocks");
    : (@allimgfiles) = readdir THEDIR; closedir THEDIR;
    : [/code]
    : When I go to http://www.thedomain.com/imgblocks I get a list of the
    : files in the dir. You don't need any special permissions to view the
    : dir, that I am aware of.
    You can't use opendir for doing stuff over HTTP. In fact, the index you see is just a generated HTML page. So my guess is that you need to grab that, then extract the data from it. Should be easy enough with pattern match and the g modifier. :-)

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • davidrtgdavidrtg Posts: 95Member
    : : I'm trying to run an opendir function on another domains dir.
    : Unlikely to work, as it's for stuff accessible through the normal filesystem.
    :
    : : The following isn't working. Any ideas or can this be done at all?
    : : [code]
    : : opendir(THEDIR,"http://www.thedomain.com/imgblocks");
    : : (@allimgfiles) = readdir THEDIR; closedir THEDIR;
    : : [/code]
    : : When I go to http://www.thedomain.com/imgblocks I get a list of the
    : : files in the dir. You don't need any special permissions to view the
    : : dir, that I am aware of.
    : You can't use opendir for doing stuff over HTTP. In fact, the index you see is just a generated HTML page. So my guess is that you need to grab that, then extract the data from it. Should be easy enough with pattern match and the g modifier. :-)
    :
    : Jonathan
    :
    : ###
    : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    :
    Yah, I didn't think that would be possible. Thanks for pointing me in the right direction Jonathan!

    David

Sign In or Register to comment.