Page 1 of 1
More about Directories.
Posted: Thu Sep 21, 2006 5:17 pm
by JellyFish
The opendir() function has an argument which should be the directory in which you want to open. What I want to know is, what's a directory consist of?
For example, my understanding of a directory was always:
http://www.google.com, file:///C:/My Documents/, etc. But when I come across this function, it's demanding something like: /home/www/whatever.com/, and such.
So what I want to understand is this: /home/www/whatever.com/. I would like to know what makes a directory in this case???
Thanks for reading.
Posted: Thu Sep 21, 2006 5:38 pm
by feyd
Neither of your first two examples are directories, but URLs. The first being an internet site and the second being a directive to your local file system.
A directory, or folder as Windows (and some Macs) call them, is a container. Differing operating systems use differing marks to distinguish between directories and files. For instance, some use "/", while others use "\" a few even use ":". They are just a means to storing data in a structured way as we like our structure, while the computer doesn't really care too much.
C:\Windows is a directory (or folder) for example.
Posted: Thu Sep 21, 2006 6:29 pm
by JellyFish
I see. So they're URLs. But what my question is, how do I know what to give as an argument for opendir() function? I don't know what the directory for my web site looks like, only it's URL. You know what I trying to say?
Posted: Thu Sep 21, 2006 6:52 pm
by feyd
$_SERVER['DOCUMENT_ROOT'] may be of interest.
so may the return from
dirname(__FILE__)
Posted: Thu Sep 21, 2006 7:15 pm
by JellyFish
Thanks feyd. But is there an artical on what home in /home/www/mysite.com/ means? And the www in it aswell, etc? Also is there a way to access a directory from another server? Like say I want one site to get something from another?
Posted: Thu Sep 21, 2006 7:33 pm
by feyd
They don't actually mean much of anything; they're just directories. There are some common directories used on various flavors of *nix, but in general you don't need to worry about them.
Posted: Thu Sep 21, 2006 8:00 pm
by JellyFish
There are some common directories used on various flavors of *nix, but in general you don't need to worry about them.
That I don't understand. But what I do understand now, is that my question has evolved into:
How do I access another directory? e.g. Use the opendir() function and apply an directory from another server as it's argument.
Posted: Thu Sep 21, 2006 8:04 pm
by feyd
opendir() last I checked, cannot open another server's directories.
Posted: Thu Sep 21, 2006 8:12 pm
by JellyFish
Then how could I accoplish this, if not even with php?
Posted: Thu Sep 21, 2006 8:16 pm
by feyd
Why not explain what you're trying to do?
Posted: Thu Sep 21, 2006 8:21 pm
by JellyFish
I'm trying to display files and folders from another server.
Posted: Fri Sep 22, 2006 1:26 am
by Luke