parent directory
parent directory
Missing a command returning the parent directory of a given path complying with the canonize style.
Re: parent directory
Sorry i posted it in the wrong whishlist
- airsoftsoftwair
- Posts: 5834
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: parent directory
Hmm, what exactly are you trying to do? This works here and prints the full path of the parent directory:
Code: Select all
DebugPrint(CanonizePath(".."))
Re: parent directory
No I have a string with a path i.e. "C:/Barba/MieiProgrammi/icons/fiw/" and I want the parent directory of that string then "C:/Barba/MieiProgrammi/icons/"
As far as I intend the command you suggested works on the current path of the program, but I do not want to change it.
actually I have solved it in such way but obviously I also have to manage it differently on the different os's
Local aa,cn=SplitStr(nome_dir$,slash$)
nome_dir$=""
For Local t=0 To cn-3
nome_dir$=nome_dir$..aa[t]..slash$
Next
As far as I intend the command you suggested works on the current path of the program, but I do not want to change it.
actually I have solved it in such way but obviously I also have to manage it differently on the different os's
Local aa,cn=SplitStr(nome_dir$,slash$)
nome_dir$=""
For Local t=0 To cn-3
nome_dir$=nome_dir$..aa[t]..slash$
Next
Re: parent directory
Or something like this:
Code: Select all
PathPart(TrimStr(dir$, "/", True))Re: parent directory
Why don't you like Andreas' second option?
It works if the path exists.
It works if the path exists.
Code: Select all
dir$="C:/Barba/MieiProgrammi/icons/fiw/"
DebugPrint(CanonizePath(dir$..".."))
Re: parent directory
it works thanks. I was unable to understand such fine tuning from the help or per my limited skill