Page 1 of 1

Filename For Linux?

Posted: Fri Oct 29, 2004 1:35 am
by Zorth
Hey all,

This is a simple question. I'm trying to get this PHP script to open a file on a Linux system, and the file is not in the htdocs directory, rather it's in the main hard drive area. If the file was somewhere like: "C:\folder1\text.txt", how would the syntax go for the file? It doesn't seem to work the same way as it did in Windows.

Thanks.

Posted: Fri Oct 29, 2004 3:17 am
by Christopher
/somewhere/folder1/text.txt

Posted: Fri Oct 29, 2004 9:03 am
by Zorth
Hey, thanks for the reply. I noticed you put /somewhere, what would somewhere be? The drive it's in? Also, wouldn't /somewhere tell it to look for that folder in the htdocs directory?

Posted: Fri Oct 29, 2004 9:15 am
by kettle_drum
In linux / is root of the file system node, so all other directories are in this one. /home/blah will start from the root of the file system and not the directory you are in. The usual rules then apply where ../ is one dir back up the tree and no / is the current directory.