|
Posted by Jerry Stuckle on 10/16/07 01:53
duzhidian@gmail.com wrote:
> Thanks for your guys info. All your suggestions is to use absolute
> path somewhere.
>
> In fact, here is my scenario, *SAME* file name, different location:
>
> a. one php is locate at . called ./mylib.php
> b. another php file is located at ./lib/mylib.php
> c. third php file is located at ./lib/sublib/mylib.php
>
>
> a calls a function in b while b calls a function in c.
>
> What I need is just a clear picture how to include files in a and b,
> i.e. in ./mylib.php and in ./lib/mylib.php without any trouble when
> moving and future extension.
>
>
> I can organize the codes, but it does not seems as transparent as what
> c/c++ does as one file at root have to consider it's grandsons'
> functions (location), not supposed to do that in c/c++.
>
> Thanks again.
>
> Du.
>
>
You're still using relative paths. Anything starting with ".", ".." or
a path name is relative.
Absolute paths start with / in linux/unix.
It works exactly the same in C/C++. Relative paths there are relative
to the executable.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|