Howdy, Stranger!

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

Categories

hdd browsing with perl, is it possible?

KrystiKrysti Member Posts: 2
Hi, basically I'm writting a program using html and perl that will search a directory for all html files, display the file names in html and allow a user to specify a hierarchy level for each file. The program will then add navigation features to each html file based on the specified hierarchy structure. I have two issues I'm trying to work out. The first is that I want to program to default to search the directory that the script is located in, but I also want the user to be able to browse their hdd for a directory. Kind of in the fashion of an install wizzard. Is there any code around that can do that?

Second, I want to be able to visually display the hierarchy structure that the user has specified. I'm thinking that it might be possible to create it using tables, but I'd really like some input as to whether there may be a better tactic.

Comments

  • heeroyuyheeroyuy Member Posts: 125
    : Hi, basically I'm writting a program using html and perl that will search a directory for all html files, display the file names in html and allow a user to specify a hierarchy level for each file. The program will then add navigation features to each html file based on the specified hierarchy structure. I have two issues I'm trying to work out. The first is that I want to program to default to search the directory that the script is located in, but I also want the user to be able to browse their hdd for a directory. Kind of in the fashion of an install wizzard. Is there any code around that can do that?
    :
    : Second, I want to be able to visually display the hierarchy structure that the user has specified. I'm thinking that it might be possible to create it using tables, but I'd really like some input as to whether there may be a better tactic.
    :

    If this is a CGI script, then no, there is no code that I know of at least to browse a clients hard drive, considering the.....possibilities *snicker* of being able to see a clients file structure. I know you could navigate the webserver, there are plenty commands in perl to navigate through directories, but none that I know of allow you to browse a clients hd.
    -----------------------
    "Useless peons, bow down before me, for I am root!"
    HeeroYuy
    www.mediaon3.com Webmaster

  • KrystiKrysti Member Posts: 2
    Ok, assuming I only want to be able to browse the webserver directories and that there are no security issues (eg. it could be my server) do you know of any existing code that could implement the hdd browsing?
  • JonathanJonathan Member Posts: 2,914
    : Ok, assuming I only want to be able to browse the webserver directories and that there are no security issues (eg. it could be my server) do you know of any existing code that could implement the hdd browsing?
    :

    Hi,

    Can't think of any code I've seen to do that, but I know the opendir, readdir and closedir commands will probably help you out.

    Jonathan


    -------------------------------------------
    Count downloads from your site for free!
    http://www.downloadcounter.com/
    Oh yeah, I run a web hosting thing now too.
    http://www.incrahost.com/

  • heeroyuyheeroyuy Member Posts: 125
    There is a perl command to browse directories as I recall. As I recall it is as follows

    [code]
    chdir "directory to switch to from cwd";
    [/code]

    Also, if it is a unix server, you should be able to execute many unix command directy from within the script, without leaving the script(example: I think you can do a chmod without using exec "chmod 777 whatever"). Tell me if this works. If not, i can probably dig up the precise code somewhere. If you need the contents of the directories, etc, thre are some other basic commands that will help you. I can also post those if you need them.
    -----------------------
    "Useless peons, bow down before me, for I am root!"
    HeeroYuy
    www.mediaon3.com Webmaster

  • Justin BibJustin Bib USAMember Posts: 0

    _____ ( http://forcoder.org ) free ebooks and video tutorials about \ Delphi, C++, PL/SQL, C#, R, Visual Basic, Ruby, C, Scratch, Java, MATLAB, Swift, PHP, Perl, JavaScript, Objective-C, Python, Visual Basic .NET, Assembly, Go Ada, Erlang, Julia, Logo, Bash, Fortran, ML, Alice, Scheme, Rust, F#, SAS, Lisp, Prolog, Kotlin, COBOL, Awk, Hack, ABAP, VBScript, FoxPro, Apex, Scala, Crystal, Dart, Clojure, Lua, D, LabVIEW, Transact-SQL \ ____

Sign In or Register to comment.