File System Mangement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Angelos

    File System Mangement

    Hello.. I am trying to make a filesystem management script.
    I want to display a list of files and directories and be able to delete them
    from this list....
    I made a search on the net and there are loads of them but I am trying to do
    something much more simple.

    At the moment I can display everything within a folder but if I click on a
    directory it won't go into the directory, listing all contents ... it is
    just a link.

    Does anyone know any Tutorial page or if there is any function for
    directories navigation ?



  • BearItAll

    #2
    Re: File System Mangement

    On Thu, 30 Jun 2005 12:53:20 +0000, Angelos wrote:
    [color=blue]
    > Hello.. I am trying to make a filesystem management script. I want to
    > display a list of files and directories and be able to delete them from
    > this list....
    > I made a search on the net and there are loads of them but I am trying to
    > do something much more simple.
    >
    > At the moment I can display everything within a folder but if I click on a
    > directory it won't go into the directory, listing all contents ... it is
    > just a link.
    >
    > Does anyone know any Tutorial page or if there is any function for
    > directories navigation ?[/color]

    You mean the

    bool chdir(path);

    function.

    Example from the manual,

    // current directory
    echo getcwd() . "\n";

    chdir('public_h tml');

    // current directory
    echo getcwd() . "\n";


    But that isn't what you want to know really. What you really want to know
    for your application is how to collect directories and files, you don't
    need to change directory to collect those.

    Three methods,

    The first is preferred for speed when collection has to be at the time
    your code is ran. It collects as needed. So as your code looks in each
    directory it collects the file information you want, acts on it in what
    ever way your application needs, but goes no further until it is told, as
    in browsing say or triggered from code, but not a continuous collection
    process.


    The second, and worst of the three, is a full collection process at the
    time your code is ran. Try that on your ISP's site and they are likely to
    send the boys round to see you.

    Last, if you do need a full system tree/file list then consider doing this
    outside of your script. A cron job in c/c++/perl ... You could have it as
    a plain text file of directories that your code can use, or have it update
    a MySQL database. Then it's all available for use in a similar way to
    'locate' database.

    The way I see it, if you have an overnight script going to all the trouble
    of collecting dirs/files then it might as well pick out other information
    ready for quick use in utility code, to save having it go and look at the
    file itself, if your application allows.

    So a suggestion for fields might be,

    ID
    dirpath - Directory path
    filename - file name
    type - File type
    size - file size
    created - created date
    accessed - accessed date
    owner - Owner
    backupname - I used a name modifier for versions of documents. In my case
    I make use of the year-week number - week day information of the time it
    was last changed.





    Comment

    • Angelos

      #3
      Re: File System Mangement

      >> Does anyone know any Tutorial page or if there is any function for[color=blue][color=green]
      >> directories navigation ?[/color]
      >
      > You mean the
      >
      > bool chdir(path);
      >
      > function.[/color]

      I don't know if that will help, but anyway thanks for your reply...

      I'll have a look at these in a bit ;-)
      Thanks a lot


      Comment

      • Hero Wanders

        #4
        Re: File System Mangement

        Hi!
        [color=blue]
        > Hello.. I am trying to make a filesystem management script.
        > I want to display a list of files and directories and be able to delete them
        > from this list....
        > I made a search on the net and there are loads of them but I am trying to do
        > something much more simple.
        >
        > At the moment I can display everything within a folder but if I click on a
        > directory it won't go into the directory, listing all contents ... it is
        > just a link.[/color]

        I found such a script on my HD, here it is:


        HTH
        Hero Wanders

        Comment

        • Angelos

          #5
          Re: File System Mangement

          > I found such a script on my HD, here it is:[color=blue]
          > http://nopaste.php-q.net/144412[/color]

          man this script is great ... know the only thing I have to do is some how to
          restrict access to all directories except the specified....
          It shouldn't be difficult... ;-)
          Thanks again !!!


          Comment

          Working...