help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

filesep on Windows


From: John W. Eaton
Subject: filesep on Windows
Date: Tue, 23 Oct 2007 19:31:18 -0400

On 23-Oct-2007, Matthias Brennwald wrote:

| Dear all
| 
| A colleague encountered an error while running some of my code on his  
| Windows machine with Octave 2.9.15. I've tracked the problem down to  
| the fact that on Windows the file separator can be both '/' and '\'  
| within a single path, whereas the filesep function returns only '\':
| 
| ---------------------
| which('mataa_path.m')
| which: `mataa_path.m' is the script file
| c:/octave/mataa/mataa_tools\mataa_path.m
| 
| filesep
| ans = \
| ---------------------
| 
| What is the logic behind using two different types of file separators  
| on Windoze?

As far as I can tell from looking at the code, the which function is
ultimately looking through the load path and once it finds the file,
it concatenates the directory where the file is found with the file,
separated by filesep.  So what does

  path

print on the Windows system?  I'd guess it includes

  c:/octave/mataa/mataa_tools

I'm not sure why forward slashes are used here instead of filesep.
How was that directory added to the path?

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]