Strange behaviour of DIRECTORY

7 messages Options
Embed this post
Permalink
Guillaume Lemaître-2

Strange behaviour of DIRECTORY

Reply Threaded More More options
Print post
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  Hi,

Before any further investigation, I wanted to know if someone has any
clue on the not-so-homogenous behaviour of DIRECTORY.

For example, if I have an instance 'wd' of DIRECTORY:
  - wd.scan( ".") ==> wd.path = "/foo/bar/"
  - wd.scan( ".." ) ==> wd.path = "/foo"

The issue is that I was supposing that I could rebuild path of any file
by concatenation of wd.path and wd.item, totally ignoring kind of
directory separators shall be used on a particular system.

As I don't know if it is supposed to work this way, I cannot say if
wd.scan( ".." ) not setting wd.path to "/foo/" is a bug.

Does anybody has a clue?

Regards,

        Guillaume
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmbJNsACgkQGl8D2UjaREATmACeLS/T2XZ7QKa/ZfayUjnixpi6
HeIAnjiAP8mI0I9E4LRhhPZPI8NWtwRa
=TNdb
-----END PGP SIGNATURE-----
Guillaume Lemaître-2

Re: Strange behaviour of DIRECTORY

Reply Threaded More More options
Print post
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Guillaume Lemaître a écrit :

>   Hi,
>
> Before any further investigation, I wanted to know if someone has any
> clue on the not-so-homogenous behaviour of DIRECTORY.
>
> For example, if I have an instance 'wd' of DIRECTORY:
>   - wd.scan( ".") ==> wd.path = "/foo/bar/"
>   - wd.scan( ".." ) ==> wd.path = "/foo"
>
> The issue is that I was supposing that I could rebuild path of any file
> by concatenation of wd.path and wd.item, totally ignoring kind of
> directory separators shall be used on a particular system.
>
> As I don't know if it is supposed to work this way, I cannot say if
> wd.scan( ".." ) not setting wd.path to "/foo/" is a bug.
>
> Does anybody has a clue?
>
> Regards,
>
> Guillaume
  Hello,

Here is a small patch (on 2.3) that fixes the issue.

Regards,

        Guillaume
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmcbo4ACgkQGl8D2UjaRECTBgCgkexv09bBK2tWvWkIHPqLiK/K
TtEAn2/ls4HFvKyxKVPfLuXzNtkUL9Sp
=08/O
-----END PGP SIGNATURE-----

--- SmartEiffel/lib/io/internal/unixish_path_name.e 2007-07-11 19:23:43.000000000 +0200
+++ SmartEiffel/lib/io/internal/unixish_path_name.e 2009-02-18 21:19:53.000000000 +0100
@@ -68,7 +68,7 @@
  elseif lst.is_equal(up_directory) then
  add_last(up_directory)
  else
- remove_last
+ path.remove_tail(lst.count)
  end
  end
  end
Cyril ADRIAN

Re: Strange behaviour of DIRECTORY

Reply Threaded More More options
Print post
Permalink
Hi Guillaume,

On Wed, Feb 18, 2009 at 9:24 PM, Guillaume Lemaître <[hidden email]> wrote:
--- SmartEiffel/lib/io/internal/unixish_path_name.e     2007-07-11 19:23:43.000000000 +0200
+++ SmartEiffel/lib/io/internal/unixish_path_name.e     2009-02-18 21:19:53.000000000 +0100
@@ -68,7 +68,7 @@
                               elseif lst.is_equal(up_directory) then
                                       add_last(up_directory)
                               else
-                                       remove_last
+                                       path.remove_tail(lst.count)
                               end
                       end
               end

Did you test under Windows too? (IIRC it's also a "unixish" path name...) ;-)

Best regards,
--
Cyril ADRIAN

http://www.cadrian.net/~cyril
Guillaume Lemaître-2

Re: Strange behaviour of DIRECTORY

Reply Threaded More More options
Print post
Permalink
2009/2/19, Cyril ADRIAN <[hidden email]>:

> Hi Guillaume,
>
> On Wed, Feb 18, 2009 at 9:24 PM, Guillaume Lemaître
> <[hidden email]> wrote:
> > --- SmartEiffel/lib/io/internal/unixish_path_name.e
> 2007-07-11 19:23:43.000000000 +0200
> > +++ SmartEiffel/lib/io/internal/unixish_path_name.e
> 2009-02-18 21:19:53.000000000 +0100
> > @@ -68,7 +68,7 @@
> >                                elseif lst.is_equal(up_directory) then
> >                                        add_last(up_directory)
> >                                else
> > -                                       remove_last
> > +                                       path.remove_tail(lst.count)
> >                                end
> >                        end
> >                end
> >
>
> Did you test under Windows too? (IIRC it's also a "unixish" path name...)
> ;-)
>
> Best regards,
> --
> Cyril ADRIAN
>
> http://www.cadrian.net/~cyril
>

No. I will then make further tests and keep you informed.

  Guillaume
Daniel F Moisset-3

Re: Strange behaviour of DIRECTORY

Reply Threaded More More options
Print post
Permalink
In reply to this post by Guillaume Lemaître-2
On Tue, Feb 17, 2009 at 6:58 PM, Guillaume Lemaître
<[hidden email]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>  Hi,
>
> Before any further investigation, I wanted to know if someone has any
> clue on the not-so-homogenous behaviour of DIRECTORY.

If you are working on these kind of path manipulations perhaps you
want to take a look to the PATH_NAME class...

Regards,
   D.
Guillaume Lemaître-2

Re: Strange behaviour of DIRECTORY

Reply Threaded More More options
Print post
Permalink
In reply to this post by Cyril ADRIAN
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Cyril ADRIAN a écrit :

> Hi Guillaume,
>
> On Wed, Feb 18, 2009 at 9:24 PM, Guillaume Lemaître <
> [hidden email]> wrote:
>
>> --- SmartEiffel/lib/io/internal/unixish_path_name.e     2007-07-11
>> 19:23:43.000000000 +0200
>> +++ SmartEiffel/lib/io/internal/unixish_path_name.e     2009-02-18
>> 21:19:53.000000000 +0100
>> @@ -68,7 +68,7 @@
>>                                elseif lst.is_equal(up_directory) then
>>                                        add_last(up_directory)
>>                                else
>> -                                       remove_last
>> +                                       path.remove_tail(lst.count)
>>                                end
>>                        end
>>                end
>>
>
> Did you test under Windows too? (IIRC it's also a "unixish" path name...)
> ;-)
>
> Best regards,

Forget about this patch, it is not good at all! I'll rework it soon, in
order to be in next 2.4?

        Guillaume
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkmn4kYACgkQGl8D2UjaRECqFwCbBsyzkIdJ+3wkxKXSvq+xlcPB
5bEAnRndQHfdHnysoNzmv7TFIgnJlyKF
=Jbjm
-----END PGP SIGNATURE-----
Cyril ADRIAN

Re: Strange behaviour of DIRECTORY

Reply Threaded More More options
Print post
Permalink
Hi Guillaume,

On Fri, Feb 27, 2009 at 1:53 PM, Guillaume Lemaître <[hidden email]> wrote:
Forget about this patch, it is not good at all!

OK
 
I'll rework it soon, in order to be in next 2.4?

Sure- you still have time ;-)

Best regards,
--
Cyril ADRIAN

http://www.cadrian.net/~cyril