How To Move up one dir

Using this code
I am able to cycle through the contents of the current dir,

what i want to do is the same thing for the dir above the ccurrent i thought that
would do the job but is does not what is the corrent argument for one dir above the current one.

thanks -k-
Who is Participating?
axis_imgConnect With a Mentor Commented:
One other suggestion, which is admittedly a bit of a hack, is to simply chdir() directly before opening the current directory ("."). An example would be:

$thisdir = opendir("."); // now the current directory is actually ".."

// do stuff here...

If I am not understanding what you are asking, please let me know.

opendir("..") has always worked for me. Can you give some information as to what system you are running currently?

Also, try:


I do not think the slash should make a big difference, as both methods work for me. Just to be sure though.

kplonkAuthor Commented:
Seems i .. was wroking however the proble laied more in the script the chdir() command sorted that so thatanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.