SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2000
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    I have created a script/function that checks all the files in a specified directory for HTML comment tags and if it finds any, it removes the HTML comments and copies everything from the directory into a new directory. Therefore, we end up with 2 directories. 1 with files containing HTML comments and the other with files that have had the comments removed.

    The point of all of this is security. We donít want the user to see the HTML comments, however the developerís need them, to assist with structured programming.

    This function works just fine, however Iíd now like to increase the scope of the function so that it will remove the comments from all files below the directory. At the moment it just goes through one directory and if it encounters another directory it wonít go through that directory as well.

    So my question is:

    How can I ensure that I will cover every file of every directory. Is there a special order that it needs to be done in. I.e. do I need to go to the bottom of the directory and work my way up? Do I need to map the path when changing directories? Do I need to use recursion. Basically, Iím not sure how to approach this!!!!

    Iíd be very grateful if you could helpÖ..

    Regards,

    Jason

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2000
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    problem solved - cheers..

    Jason

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you have time - do you mind sharing the solution?

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2000
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    see my next post for the solution...!!!


    Jason

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2000
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2000
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •