librelist archives

« back to archive

DIRECTORY

DIRECTORY

From:
Raphael Mack
Date:
2013-03-20 @ 20:33
Hello,

Cyril, you rewrote the DIRECTORY class since the import from SE. While
taking a look at the directory tutorial, I noticed, that you removed
last_scan_status. I do not miss that thing, but what if the path passed
to scan actually is not a valid directory path? How does the user
notice? Shall exists be used? But what if the same DIRECTORY instance
gets two invocations of scan, the first with a valid path, the second
with an invalid. Isn't here a "exists := False" missing?

Currently DIRECTORY.scan relies on the passed path to be a valid
directory, which we should either formulate in preconditions or remove
this assumption. And with "/" is also crashes, even though this is a
valid path on unix systems.

At the end the directory examples have to be fixed, such that they
success with arguments "/", "/invalid/whatever/path" and "/invalid".

I can do this, but I need some advice, please.

Cheers,
Rapha

Re: [libertyeiffel] DIRECTORY

From:
Cyril Adrian
Date:
2013-03-21 @ 13:52
 Hi,

2013/3/20 Raphael Mack <ramack@raphael-mack.de>

> Cyril, you rewrote the DIRECTORY class since the import from SE. While
> taking a look at the directory tutorial, I noticed, that you removed
> last_scan_status. I do not miss that thing, but what if the path passed
> to scan actually is not a valid directory path? How does the user
> notice? Shall exists be used? But what if the same DIRECTORY instance
> gets two invocations of scan, the first with a valid path, the second
> with an invalid. Isn't here a "exists := False" missing?
>

`scan` is feature {} so that should not happen ;-)

Currently DIRECTORY.scan relies on the passed path to be a valid
> directory, which we should either formulate in preconditions or remove
> this assumption.


No problem since `scan` can only be called as a creation procedure, at the
end of which `exists` is correctly set to True if the path exists.

And with "/" is also crashes, even though this is a
> valid path on unix systems.
>

Indeed there is a bug here. (I just tried)

At the end the directory examples have to be fixed, such that they
> success with arguments "/", "/invalid/whatever/path" and "/invalid".
>
> I can do this, but I need some advice, please.
>

Be careful, "/" won't work on windows ;-)

Cheers,



 *Cyril ADRIAN** (from office)*
 [image: Google Plus] <http://plus.google.com/100388810006463519079> My
latest G+: 
http://computerhistory....<http://plus.google.com/100388810006463519079/posts/DkqWMSU7bVj>
My G+ <http://plus.google.com/100388810006463519079> -
Posts<http://plus.google.com/100388810006463519079/posts/>- Add
to Circles <http://plus.google.com/100388810006463519079/about/> - 17:00
Feb-26 <http://plus.google.com/100388810006463519079>
  Get this email app!

<http://www.wisestamp.com/apps/plus?utm_source=extension&utm_medium=email&utm_term=plus&utm_campaign=apps>

  <http://fr.linkedin.com/in/cadrian/>
  Get a signature like this.

<http://r1.wisestamp.com/r/landing?promo=35&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_35>
CLICK

HERE.<http://r1.wisestamp.com/r/landing?promo=35&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_35>
​

   <http://twitter.com/cadbart>  Latest tweet:
Follow @cadbart <http://twitter.com/cadbart>    • https://t.co/ET8G4C7LhE
playing with prettiness<http://twitter.com/cadbart/statuses/314372678695919617>
• https://t.co/fCYFo2g1Cj moved
logo<http://twitter.com/cadbart/statuses/314372676665892865>
• https://t.co/E5eEdkRSxf Merge remote-tracking branch
'upstream/master'<http://twitter.com/cadbart/statuses/314285974240784384>
   View
more <http://twitter.com/cadbart>
   Get this email app!

<http://www.wisestamp.com/apps/twitter?utm_source=extension&utm_medium=email&utm_term=twitter&utm_campaign=apps>

Re: [libertyeiffel] DIRECTORY

From:
Cyril Adrian
Date:
2013-03-21 @ 14:08
 I couldn't help myself… I fixed the basic_directory bug with "/". The
short name of "/" is "/", tell me if it is the right decision (it seems to
work)

Cheers,



 *Cyril ADRIAN** (from office)*
 [image: Google Plus] <http://plus.google.com/100388810006463519079> My
latest G+: 
http://computerhistory....<http://plus.google.com/100388810006463519079/posts/DkqWMSU7bVj>
My G+ <http://plus.google.com/100388810006463519079> -
Posts<http://plus.google.com/100388810006463519079/posts/>- Add
to Circles <http://plus.google.com/100388810006463519079/about/> - 17:00
Feb-26 <http://plus.google.com/100388810006463519079>
  Get this email app!

<http://www.wisestamp.com/apps/plus?utm_source=extension&utm_medium=email&utm_term=plus&utm_campaign=apps>

  <http://fr.linkedin.com/in/cadrian/>
 Get a signature like this.

<http://r1.wisestamp.com/r/landing?promo=35&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_35>
CLICK

HERE.<http://r1.wisestamp.com/r/landing?promo=35&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_35>
​

 Latest tweet:
 • • •https://t.co/ET8G4C7LhE playing with
prettiness<http://twitter.com/cadbart/statuses/314372678695919617>
  Get this email app!

<http://www.wisestamp.com/apps/twitter?utm_source=extension&utm_medium=email&utm_term=twitter&utm_campaign=apps>



2013/3/21 Cyril ADRIAN <cyril.adrian@gmail.com>

> Hi,
>
> 2013/3/20 Raphael Mack <ramack@raphael-mack.de>
>
>> Cyril, you rewrote the DIRECTORY class since the import from SE. While
>> taking a look at the directory tutorial, I noticed, that you removed
>> last_scan_status. I do not miss that thing, but what if the path passed
>> to scan actually is not a valid directory path? How does the user
>> notice? Shall exists be used? But what if the same DIRECTORY instance
>> gets two invocations of scan, the first with a valid path, the second
>> with an invalid. Isn't here a "exists := False" missing?
>>
>
> `scan` is feature {} so that should not happen ;-)
>
> Currently DIRECTORY.scan relies on the passed path to be a valid
>> directory, which we should either formulate in preconditions or remove
>> this assumption.
>
>
> No problem since `scan` can only be called as a creation procedure, at the
> end of which `exists` is correctly set to True if the path exists.
>
> And with "/" is also crashes, even though this is a
>> valid path on unix systems.
>>
>
> Indeed there is a bug here. (I just tried)
>
> At the end the directory examples have to be fixed, such that they
>> success with arguments "/", "/invalid/whatever/path" and "/invalid".
>>
>> I can do this, but I need some advice, please.
>>
>
> Be careful, "/" won't work on windows ;-)
>
> Cheers,
>
>
>
>  *Cyril ADRIAN** (from office)*
>  [image: Google Plus] <http://plus.google.com/100388810006463519079> My
> latest G+: 
http://computerhistory....<http://plus.google.com/100388810006463519079/posts/DkqWMSU7bVj>
> My G+ <http://plus.google.com/100388810006463519079> - 
Posts<http://plus.google.com/100388810006463519079/posts/>- Add
> to Circles <http://plus.google.com/100388810006463519079/about/> - 17:00
> Feb-26 <http://plus.google.com/100388810006463519079>
>   Get this email app! 
<http://www.wisestamp.com/apps/plus?utm_source=extension&utm_medium=email&utm_term=plus&utm_campaign=apps>
>
>   <http://fr.linkedin.com/in/cadrian/>
>   Get a signature like this.
> 
<http://r1.wisestamp.com/r/landing?promo=35&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_35>
CLICK
> 
HERE.<http://r1.wisestamp.com/r/landing?promo=35&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_35>
> ​
>
>    <http://twitter.com/cadbart>  Latest tweet:
> Follow @cadbart <http://twitter.com/cadbart>    • https://t.co/ET8G4C7LhE
> playing with prettiness<http://twitter.com/cadbart/statuses/314372678695919617>
> • https://t.co/fCYFo2g1Cj moved 
logo<http://twitter.com/cadbart/statuses/314372676665892865>
> • https://t.co/E5eEdkRSxf Merge remote-tracking branch 
'upstream/master'<http://twitter.com/cadbart/statuses/314285974240784384>
View
> more <http://twitter.com/cadbart>
>    Get this email app! 
<http://www.wisestamp.com/apps/twitter?utm_source=extension&utm_medium=email&utm_term=twitter&utm_campaign=apps>
>
>
>

Re: [libertyeiffel] DIRECTORY

From:
Raphael Mack
Date:
2013-03-21 @ 20:27
Hi,

Am Donnerstag, den 21.03.2013, 14:52 +0100 schrieb Cyril ADRIAN: 
> 2013/3/20 Raphael Mack <ramack@raphael-mack.de>
>         last_scan_status. I do not miss that thing, but what if the
>         path passed
>         to scan actually is not a valid directory path? How does the
>         user
>         notice? Shall exists be used? But what if the same DIRECTORY
>         instance
>         gets two invocations of scan, the first with a valid path, the
>         second
>         with an invalid. Isn't here a "exists := False" missing? 

> `scan` is feature {} so that should not happen ;-)

oh, I should learn to read all words ;-)
> 
>         Currently DIRECTORY.scan relies on the passed path to be a
>         valid
>         directory, which we should either formulate in preconditions
>         or remove
>         this assumption. 

> 
> No problem since `scan` can only be called as a creation procedure, at
> the end of which `exists` is correctly set to True if the path exists.

Yes, so exists is the query to use. 
> 
> 
>         And with "/" is also crashes, even though this is a
>         valid path on unix systems. 
> 
> 
> Indeed there is a bug here. (I just tried)
> 
> 
>         At the end the directory examples have to be fixed, such that
>         they
>         success with arguments "/", "/invalid/whatever/path" and
>         "/invalid".
>         
>         I can do this, but I need some advice, please. 
> 
> 
> Be careful, "/" won't work on windows ;-)

Of cause, but as the path is given as command line argument to the
example program the user is in charge of giving the correct notation. 
Thanks for the fix,

Rapha