MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problems with DirectoryName

Hi Janko,

DirectoryName takes a path in the syntax for a path in the computer OS
that it is executed in and returns a Directory name in that same
syntax.  If you give it a path in the syntax of another computer's OS
then it simply thinks that you have given it a pure string (with no
$PathnameSeparator appearing in it) and hence returns the Blank that
you wittnessed in your second case.



Janko Slavic wrote:
> Hi!
> I would like to get the directory name out of a full path filename
> string.
> It seems like the DirectoryName is not working the same with "\\" or
> "/".
> DirectoryName["d:\\temp\\test.txt"] => d:\temp\
> DirectoryName["d:/temp/test.txt"] => Blank
> I would like the solution to be platform independent.
> Any advices are greatly appreciated!

  • Prev by Date: Re: NDSolve
  • Next by Date: Re: bug in Partition?
  • Previous by thread: Problems with DirectoryName
  • Next by thread: Reaction-diffusion PDEs