(FileDirectory default directoryContentsFor: '') is moby confused

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

(FileDirectory default directoryContentsFor: '') is moby confused

KenDickey

(FileDirectory default directoryContentsFor: '') explore.

This gives a collection of directory entries in my home directory, that is the names are of files in my home directory.

BUT the interior pathname in each directory entry is to the Cuis startup directory!

Directory Choices for directoryContentsFor: ''

  [0] The comment in #FileDirectory>>primLookupEntryIn:index:
        says contents of '/' on Unix/Linux

  [1] My home directory

  [2] The Cuis startup/image directory

I actually prefer [2].

Halp!
-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

Juan Vuletich-4
Hi Ken,

On 02/06/2014 12:17 a.m., Ken Dickey wrote:

> (FileDirectory default directoryContentsFor: '') explore.
>
> This gives a collection of directory entries in my home directory, that is the names are of files in my home directory.
>
> BUT the interior pathname in each directory entry is to the Cuis startup directory!
>
> Directory Choices for directoryContentsFor: ''
>
>    [0] The comment in #FileDirectory>>primLookupEntryIn:index:
> says contents of '/' on Unix/Linux
>
>    [1] My home directory
>
>    [2] The Cuis startup/image directory
>
> I actually prefer [2].
>
> Halp!
> -KenD
>

The difference between platforms lies in the primitive... Maybe we'd
just correct the comment, and include a warning discouraging calling
eDirectory default directoryContentsFor: '' , maybe even raising an
exception, and suggest calling FileDirectory default
directoryContentsFor: './' or FileDirectory default
directoryContentsFor: '/' .

What do you all think, folks?

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

KenDickey
On Mon, 02 Jun 2014 10:21:26 -0300
Juan Vuletich <[hidden email]> wrote:


> The difference between platforms lies in the primitive... Maybe we'd
> just correct the comment, and include a warning discouraging calling
> eDirectory default directoryContentsFor: '' , maybe even raising an
> exception, and suggest calling FileDirectory default
> directoryContentsFor: './' or FileDirectory default
> directoryContentsFor: '/' .
>
> What do you all think, folks?

My personal preference is for '.' on Unix/Linix/

BTW
  (FileDirectory default directoryContentsFor: '/')
also gives me DirEntries with root file names but the Cuis image directory.

--
-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

Juan Vuletich-4
On 02/06/2014 10:35 a.m., Ken Dickey wrote:

> On Mon, 02 Jun 2014 10:21:26 -0300
> Juan Vuletich<[hidden email]>  wrote:
>
>
>> The difference between platforms lies in the primitive... Maybe we'd
>> just correct the comment, and include a warning discouraging calling
>> eDirectory default directoryContentsFor: '' , maybe even raising an
>> exception, and suggest calling FileDirectory default
>> directoryContentsFor: './' or FileDirectory default
>> directoryContentsFor: '/' .
>>
>> What do you all think, folks?
> My personal preference is for '.' on Unix/Linix/
>
> BTW
>    (FileDirectory default directoryContentsFor: '/')
> also gives me DirEntries with root file names but the Cuis image directory.
>

Oh, I wasn't aware of that! In Windows, FileDirectory default
directoryContentsFor: '' also gives root entries (disk volume names),
but in the Cuis image directory. Really messy.

Makes me wonder... Maybe it is time to move on to FileSystem, as Pharo
did? Anyone took a close look at it, or have an opinion or thoughts?

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

KenDickey
On Mon, 02 Jun 2014 10:45:59 -0300
Juan Vuletich <[hidden email]> wrote:

> On 02/06/2014 10:35 a.m., Ken Dickey wrote:
..

> > BTW
> >    (FileDirectory default directoryContentsFor: '/')
> > also gives me DirEntries with root file names but the Cuis image directory.
> >
>
> Oh, I wasn't aware of that! In Windows, FileDirectory default
> directoryContentsFor: '' also gives root entries (disk volume names),
> but in the Cuis image directory. Really messy.
>
> Makes me wonder... Maybe it is time to move on to FileSystem, as Pharo
> did? Anyone took a close look at it, or have an opinion or thoughts?

BTW, Squeak 4.5 has the same bug.


I suggest that
  FileDirectory default directoryContentsFor: ''
should give the same result as
  FileDirectory entries

And that the pathname handed to
  #FileDirectory>>directoryContentsFor:
be checked/expanded to be a valid full path name

$0.02
-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

KenDickey
Attached is my suggested fix.

-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

FileDirectory-directoryContentsFor.st (1K) Download Attachment
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

Juan Vuletich-4
On 6/2/2014 12:16 PM, Ken Dickey wrote:
> Attached is my suggested fix.
>
> -KenD

Thanks Ken. Will be in the update stream shortly.

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

Juan Vuletich-4
In reply to this post by KenDickey
Hi Ken,

On 02/06/2014 12:16 p.m., Ken Dickey wrote:
> Attached is my suggested fix.
>
> -KenD

With your change, in Windows, just opening a FileList meant an infinite
recursion. So I had to take a closer look. I think the root of the
problem is having an instance method in FileDirectory that operates on
_another_ directory. I just removed it. Updates in GitHub, together with
a suggestion from Germán to add back World / Quit, and a fix from Bernhard.

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

garduino
Thanks!


2014-06-03 9:44 GMT-03:00 Juan Vuletich <[hidden email]>:
Hi Ken,


On 02/06/2014 12:16 p.m., Ken Dickey wrote:
Attached is my suggested fix.

-KenD

With your change, in Windows, just opening a FileList meant an infinite recursion. So I had to take a closer look. I think the root of the problem is having an instance method in FileDirectory that operates on _another_ directory. I just removed it. Updates in GitHub, together with a suggestion from Germán to add back World / Quit, and a fix from Bernhard.

Cheers,
Juan Vuletich


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org



--
Saludos / Regards,
Germán Arduino
www.arduinosoftware.com

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: (FileDirectory default directoryContentsFor: '') is moby confused

KenDickey
In reply to this post by Juan Vuletich-4
On Tue, 03 Jun 2014 09:44:54 -0300
Juan Vuletich <[hidden email]> wrote:

> With your change, in Windows, just opening a FileList meant an infinite
> recursion. So I had to take a closer look. I think the root of the
> problem is having an instance method in FileDirectory that operates on
> _another_ directory. I just removed it. Updates in GitHub, together with
> a suggestion from Germán to add back World / Quit, and a fix from Bernhard.

Much better fix.

Very elegant!

Thanks!!
-KenD

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD