Re: idl5.5 bug (relative path) [message #29176] |
Thu, 07 February 2002 10:40  |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
Paul van Delst wrote:
> Reimar Bauer wrote:
>>
>> Hi,
>>
>> I have problems accessing data over a relative paths.
>>
>> $ ls ../../../../data/mo_output/modell_original_output/test.dat
>> gives ../../../../data/mo_output/modell_original_output/test.dat
>>
>>
print,file_test('../../../../data/mo_output/modell_original_ output/test.dat')
>> 0
>>
>> Is there a work around known?
>
> Things like
>
> print,file_test('~/data/mo_output/modell_original_output/tes t.dat')
>
> won't work either.
>
> bummer.
>
> paulv
>
I can understand that. ~ is a shell expansion (and only in some shells) so
if it doesn't use a sub-process and a shell which understands ~, ~ won't
get expanded.
But it would be useful (at least on UNIX, I'm not sure what Windows would
make of it).
--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
|
|
|
|
Re: idl5.5 bug (relative path) [message #29198 is a reply to message #29195] |
Thu, 07 February 2002 03:33   |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
Reimar Bauer wrote:
> Hi,
>
> I have problems accessing data over a relative paths.
>
>
> $ ls ../../../../data/mo_output/modell_original_output/test.dat
> gives ../../../../data/mo_output/modell_original_output/test.dat
>
> print,file_test('../../../../data/mo_output/modell_original_ output/test.dat')
> 0
>
>
> Is there a work around known?
>
> Reimar
Unfortunately I can confirm this bug on Linux, IRIX and Solaris.
It goes wrong at the ../../.. stage (../.. is ok).
Can you use file_expand_path()? This seems to do relative paths ok.
E.g. on my system :
IDL> print,file_test('../../../../data/nmw')
0
IDL> print,file_test(file_expand_path('../../../../data')+'/nmw')
1
--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
|
|
|
Re: idl5.5 bug (relative path) [message #29266 is a reply to message #29176] |
Fri, 08 February 2002 01:16  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Nigel Wade wrote:
>
> Paul van Delst wrote:
>
>> Reimar Bauer wrote:
>>>
>>> Hi,
>>>
>>> I have problems accessing data over a relative paths.
>>>
>>> $ ls ../../../../data/mo_output/modell_original_output/test.dat
>>> gives ../../../../data/mo_output/modell_original_output/test.dat
>>>
>>>
> print,file_test('../../../../data/mo_output/modell_original_ output/test.dat')
>>> 0
>>>
>>> Is there a work around known?
>>
>> Things like
>>
>> print,file_test('~/data/mo_output/modell_original_output/tes t.dat')
>>
>> won't work either.
>>
>> bummer.
>>
>> paulv
>>
>
> I can understand that. ~ is a shell expansion (and only in some shells) so
> if it doesn't use a sub-process and a shell which understands ~, ~ won't
> get expanded.
>
> But it would be useful (at least on UNIX, I'm not sure what Windows would
> make of it).
This has worked by idl5.4.1 and it is not described anywhere that it
should
not work in idl5.5.
Reimar
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======
|
|
|
Re: idl5.5 bug (relative path) [message #29269 is a reply to message #29198] |
Thu, 07 February 2002 15:28  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Nigel Wade <nmw@ion.le.ac.uk> writes:
> Reimar Bauer wrote:
>> Hi,
>>
>> I have problems accessing data over a relative paths.
>>
>>
>> $ ls ../../../../data/mo_output/modell_original_output/test.dat
>> gives ../../../../data/mo_output/modell_original_output/test.dat
>>
>> print,file_test('../../../../data/mo_output/modell_original_ output/test.dat')
>> 0
>>
>>
>> Is there a work around known?
>>
>> Reimar
> Unfortunately I can confirm this bug on Linux, IRIX and Solaris.
> It goes wrong at the ../../.. stage (../.. is ok).
I tried this with IDL/v5.4.1 on my Alpha workstation, and had no problems. I
was able to make it work to five levels, at which point I stopped testing.
IDL> print,file_test('../../../../../.cshrc')
1
One thing you have to be careful about is that none of the directories can be
logical links to other places. For example, on my system I can do the
following
> echo $PWD
/disk1/thompson/temp
> cd ..
> echo $PWD
/disk10/thompson
If you were in the temp directory, you might think that .. would take you to
/disk1/thompson, but it actually takes you to /disk10/thompson, because temp is
really a logical link to a directory on a different disk. Is it possible that
this is what is causing the problem?
William Thompson
|
|
|