Accessing files from a different drive

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

    Accessing files from a different drive

    I'm building a web application using PHP to play my mp3z. My first
    step is to just list the albums that I have. Each album is a folder
    on my hard drive. The problem I am having is that I'm trying to list
    these folders from a different drive.

    For instance:
    -----------------------
    <?php
    $dir = "/";

    // Open a known directory, and proceed to read its contents
    if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
    while (($file = readdir($dh)) !== false) {
    if ($file != "." && $file != "..") {
    echo "$file";?><br>< ?
    }
    }
    closedir($dh);
    }
    }
    ?>
    -------------------------
    Displays:
    AUTOEXEC.BAT
    boot.ini
    CONFIG.SYS
    Documents and Settings
    eclipse
    ..
    ..
    ..
    --------------------------

    -> The above code shows me that the root directory is the contents in
    my C drive. I have organized my hard drive to keep my music in a
    different partition. (M:).

    So my question is, how can I list the files in my M: (which contains
    my music albums)???

    Thanks!
  • Tim Van Wassenhove

    #2
    Re: Accessing files from a different drive

    > $dir = "/";[color=blue]
    >
    > -> The above code shows me that the root directory is the contents in
    > my C drive. I have organized my hard drive to keep my music in a
    > different partition. (M:).[/color]

    $dir = "M:/";

    --
    Met vriendelijke groeten,
    Tim Van Wassenhove <http://www.timvw.info>

    Comment

    Working...