Re: Directory Recursion and Multidimensional Arrays



On Tue, 26 Sep 2006 15:03:24 GMT, Oli Filth <catch@xxxxxxxxxxxxxx>
wrote:

1. In each array (or sub-array), have $array[0] be the directory name,
and then $array[1], $array[2], ... be the sub-arrays.

2. Have each element of the array be a class object, e.g.:

class Directory
{
public $name;
public $contents;
}

where $contents is an array of child Directory objects.


As for implementation, you will need to add an extra argument to the
scan_dir_recurse() function, which you will use to pass the current
parent directory object. Then scan_dir_recurse can add child objects to
it as it finds them.

After making myself crazy with this, I think AJAX can do what I need
quite well, particurly since the directory structure is four deep and
there are duplicate directory and file names. The first select will
show the first set of directories. onSelect will generate and display
the next set of directories from a call to the script, etc. The only
gotcha is that the script is going to have to know what is a file and
what is a directory.

It ought to be an interesting application. ;-)

Thanks!

.



Relevant Pages

  • Re: Logon script - function array and select case not working
    ... this all works well, except, the function i am using for the rules in the control script causes alot of querrys to AD. as there are alot of groups. ... objTSout.writeline retrv ... So if you think that this will assign an array value to the variable, how do you think the case select statement is going go compare this array value with the literal string values such as "group name here"? ... However, by not assigning ANY value to checkgrp in the function, you are guaranteeing that, should the function ever exit, it will return no information. ...
    (microsoft.public.scripting.vbscript)
  • Re: Perl: Subroutines and use of the "GD::Graph::bars;" Module
    ... I have been looking at the script once again, I could not really get your suggestion to work, but I have been doing some new changes thought. ... @array = sort @array; ... sub verbose { ... Global symbol "$title" requires explicit package name at ./bars.pl line 53. ...
    (perl.beginners)
  • Re: string retrieval issue
    ... Chicago Bears|NFC North ... not writing the third element back to the array). ... You didn't include it in your script. ... Fear is the mind-killer. ...
    (comp.lang.perl.misc)
  • Re: Perl: Subroutines and use of the "GD::Graph::bars;" Module
    ... I did what you told me, but I just gets this error msg in return when I am trying to execute the script: ... And I also get this error msg even when I am not commenting out the settings around line 93? ... @array = sort @array; ... sub verbose { ...
    (perl.beginners)
  • Re: settimeout needs alert() ???
    ... function slider { ... and use script to replace the src and title attributes. ... are downloaded completely. ... The usual strategy is to load all of the images in to an array of image ...
    (comp.lang.javascript)