FileDoesNotExist vs FileDoesNotExistException

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

FileDoesNotExist vs FileDoesNotExistException

alistairgrant
Hi Everyone,

Does anyone know the history behind FileDoesNotExist and
FileDoesNotExistException?

Both classes exist in 6.1, and as far as I can tell, both are intended
to do the same thing, i.e. the class comments are:

FileDoesNotExist;

I am raised when an operation is attempted on a file that does not
exist. This includes cases where a file operation is attempted on a
directory.



FileDoesNotExistException:

Notify when fie does not exist



This means that programs have to check for both in exceptions, or be
very sure of whether any object they are using ultimately refers to a
File or a FileReference.

If there isn't a good reason for having both, I think we should remove
one.  Since FileDoesNotExistException is loaded first in the bootstrap
process (since it is part of Files, not FileSystem), keeping it probably
makes more sense.

Similar duplication exists for FileAlreadyExistsException and
FileExists.

Thoughts?


Thanks,
Alistair

Reply | Threaded
Open this post in threaded view
|

Re: FileDoesNotExist vs FileDoesNotExistException

CyrilFerlicot
Le 21/05/2018 à 14:58, Alistair Grant a écrit :

> Hi Everyone,
>
> Does anyone know the history behind FileDoesNotExist and
> FileDoesNotExistException?
>
> Both classes exist in 6.1, and as far as I can tell, both are intended
> to do the same thing, i.e. the class comments are:
>
> FileDoesNotExist;
>
> I am raised when an operation is attempted on a file that does not
> exist. This includes cases where a file operation is attempted on a
> directory.
>
>
>
> FileDoesNotExistException:
>
> Notify when fie does not exist
>
>
>
> This means that programs have to check for both in exceptions, or be
> very sure of whether any object they are using ultimately refers to a
> File or a FileReference.
>
> If there isn't a good reason for having both, I think we should remove
> one.  Since FileDoesNotExistException is loaded first in the bootstrap
> process (since it is part of Files, not FileSystem), keeping it probably
> makes more sense.
>
> Similar duplication exists for FileAlreadyExistsException and
> FileExists.
>
> Thoughts?
>
Hi Alistar,

See the conversation here:

https://pharo.fogbugz.com/f/cases/19026/Merge-FileDoesNotExist-and-FileDoesNotExistException

>
> Thanks,
> Alistair
>


--
Cyril Ferlicot
https://ferlicot.fr


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FileDoesNotExist vs FileDoesNotExistException

Sven Van Caekenberghe-2
I vote for the simple names without Exception in them.

> On 21 May 2018, at 15:01, Cyril Ferlicot D. <[hidden email]> wrote:
>
> Le 21/05/2018 à 14:58, Alistair Grant a écrit :
>> Hi Everyone,
>>
>> Does anyone know the history behind FileDoesNotExist and
>> FileDoesNotExistException?
>>
>> Both classes exist in 6.1, and as far as I can tell, both are intended
>> to do the same thing, i.e. the class comments are:
>>
>> FileDoesNotExist;
>>
>> I am raised when an operation is attempted on a file that does not
>> exist. This includes cases where a file operation is attempted on a
>> directory.
>>
>>
>>
>> FileDoesNotExistException:
>>
>> Notify when fie does not exist
>>
>>
>>
>> This means that programs have to check for both in exceptions, or be
>> very sure of whether any object they are using ultimately refers to a
>> File or a FileReference.
>>
>> If there isn't a good reason for having both, I think we should remove
>> one.  Since FileDoesNotExistException is loaded first in the bootstrap
>> process (since it is part of Files, not FileSystem), keeping it probably
>> makes more sense.
>>
>> Similar duplication exists for FileAlreadyExistsException and
>> FileExists.
>>
>> Thoughts?
>>
>
> Hi Alistar,
>
> See the conversation here:
>
> https://pharo.fogbugz.com/f/cases/19026/Merge-FileDoesNotExist-and-FileDoesNotExistException
>
>>
>> Thanks,
>> Alistair
>>
>
>
> --
> Cyril Ferlicot
> https://ferlicot.fr


Reply | Threaded
Open this post in threaded view
|

Re: FileDoesNotExist vs FileDoesNotExistException

Denis Kudriashov
+1

2018-05-21 16:36 GMT+03:00 Sven Van Caekenberghe <[hidden email]>:
I vote for the simple names without Exception in them.

> On 21 May 2018, at 15:01, Cyril Ferlicot D. <[hidden email]> wrote:
>
> Le 21/05/2018 à 14:58, Alistair Grant a écrit :
>> Hi Everyone,
>>
>> Does anyone know the history behind FileDoesNotExist and
>> FileDoesNotExistException?
>>
>> Both classes exist in 6.1, and as far as I can tell, both are intended
>> to do the same thing, i.e. the class comments are:
>>
>> FileDoesNotExist;
>>
>> I am raised when an operation is attempted on a file that does not
>> exist. This includes cases where a file operation is attempted on a
>> directory.
>>
>>
>>
>> FileDoesNotExistException:
>>
>> Notify when fie does not exist
>>
>>
>>
>> This means that programs have to check for both in exceptions, or be
>> very sure of whether any object they are using ultimately refers to a
>> File or a FileReference.
>>
>> If there isn't a good reason for having both, I think we should remove
>> one.  Since FileDoesNotExistException is loaded first in the bootstrap
>> process (since it is part of Files, not FileSystem), keeping it probably
>> makes more sense.
>>
>> Similar duplication exists for FileAlreadyExistsException and
>> FileExists.
>>
>> Thoughts?
>>
>
> Hi Alistar,
>
> See the conversation here:
>
> https://pharo.fogbugz.com/f/cases/19026/Merge-FileDoesNotExist-and-FileDoesNotExistException
>
>>
>> Thanks,
>> Alistair
>>
>
>
> --
> Cyril Ferlicot
> https://ferlicot.fr



Reply | Threaded
Open this post in threaded view
|

Re: FileDoesNotExist vs FileDoesNotExistException

alistairgrant
On Mon, May 21, 2018 at 03:01:57PM +0200, Cyril Ferlicot D. wrote:

> Le 21/05/2018 ?? 14:58, Alistair Grant a ??crit??:
> > Hi Everyone,
> >
> > Does anyone know the history behind FileDoesNotExist and
> > FileDoesNotExistException?
> >
> > Both classes exist in 6.1, and as far as I can tell, both are intended
> > to do the same thing, i.e. the class comments are:
> >
> > FileDoesNotExist;
> >
> > I am raised when an operation is attempted on a file that does not
> > exist. This includes cases where a file operation is attempted on a
> > directory.
> >
> >
> >
> > FileDoesNotExistException:
> >
> > Notify when fie does not exist
> >
> >
> >
> > This means that programs have to check for both in exceptions, or be
> > very sure of whether any object they are using ultimately refers to a
> > File or a FileReference.
> >
> > If there isn't a good reason for having both, I think we should remove
> > one.  Since FileDoesNotExistException is loaded first in the bootstrap
> > process (since it is part of Files, not FileSystem), keeping it probably
> > makes more sense.
> >
> > Similar duplication exists for FileAlreadyExistsException and
> > FileExists.
> >
> > Thoughts?
> >
>
> Hi Alistar,
>
> See the conversation here:
>
> https://pharo.fogbugz.com/f/cases/19026/Merge-FileDoesNotExist-and-FileDoesNotExistException

Thanks, Cyril!



On Mon, May 21, 2018 at 03:36:05PM +0200, Sven Van Caekenberghe wrote:
> I vote for the simple names without Exception in them.

On Mon, May 21, 2018 at 05:59:32PM +0300, Denis Kudriashov wrote:
> +1

Me too... :-)


I'll work on this next.

Cheers,
Alistair


Reply | Threaded
Open this post in threaded view
|

Re: FileDoesNotExist vs FileDoesNotExistException

Guillermo Polito
If I'm recalling well (which I might not :)) there is one thing (that I don't quite like) that prevents these two classes to be easily merged into one: their #defaultAction.

On Mon, May 21, 2018 at 7:07 PM, Alistair Grant <[hidden email]> wrote:
On Mon, May 21, 2018 at 03:01:57PM +0200, Cyril Ferlicot D. wrote:
> Le 21/05/2018 ?? 14:58, Alistair Grant a ??crit??:
> > Hi Everyone,
> >
> > Does anyone know the history behind FileDoesNotExist and
> > FileDoesNotExistException?
> >
> > Both classes exist in 6.1, and as far as I can tell, both are intended
> > to do the same thing, i.e. the class comments are:
> >
> > FileDoesNotExist;
> >
> > I am raised when an operation is attempted on a file that does not
> > exist. This includes cases where a file operation is attempted on a
> > directory.
> >
> >
> >
> > FileDoesNotExistException:
> >
> > Notify when fie does not exist
> >
> >
> >
> > This means that programs have to check for both in exceptions, or be
> > very sure of whether any object they are using ultimately refers to a
> > File or a FileReference.
> >
> > If there isn't a good reason for having both, I think we should remove
> > one.  Since FileDoesNotExistException is loaded first in the bootstrap
> > process (since it is part of Files, not FileSystem), keeping it probably
> > makes more sense.
> >
> > Similar duplication exists for FileAlreadyExistsException and
> > FileExists.
> >
> > Thoughts?
> >
>
> Hi Alistar,
>
> See the conversation here:
>
> https://pharo.fogbugz.com/f/cases/19026/Merge-FileDoesNotExist-and-FileDoesNotExistException

Thanks, Cyril!



On Mon, May 21, 2018 at 03:36:05PM +0200, Sven Van Caekenberghe wrote:
> I vote for the simple names without Exception in them.

On Mon, May 21, 2018 at 05:59:32PM +0300, Denis Kudriashov wrote:
> +1

Me too... :-)


I'll work on this next.

Cheers,
Alistair





--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: FileDoesNotExist vs FileDoesNotExistException

Sven Van Caekenberghe-2


> On 21 May 2018, at 20:07, Guillermo Polito <[hidden email]> wrote:
>
> If I'm recalling well (which I might not :)) there is one thing (that I don't quite like) that prevents these two classes to be easily merged into one: their #defaultAction.

We need a good talk/discussion about default actions.

I am pretty confused by them, and my first reaction is that I don't like them, too much UI in there.

Step 1 is to define clearly what #defaultAction is, what is should do, what is allowed, what not, good practices, intended purpose, etc...

> On Mon, May 21, 2018 at 7:07 PM, Alistair Grant <[hidden email]> wrote:
> On Mon, May 21, 2018 at 03:01:57PM +0200, Cyril Ferlicot D. wrote:
> > Le 21/05/2018 ?? 14:58, Alistair Grant a ??crit??:
> > > Hi Everyone,
> > >
> > > Does anyone know the history behind FileDoesNotExist and
> > > FileDoesNotExistException?
> > >
> > > Both classes exist in 6.1, and as far as I can tell, both are intended
> > > to do the same thing, i.e. the class comments are:
> > >
> > > FileDoesNotExist;
> > >
> > > I am raised when an operation is attempted on a file that does not
> > > exist. This includes cases where a file operation is attempted on a
> > > directory.
> > >
> > >
> > >
> > > FileDoesNotExistException:
> > >
> > > Notify when fie does not exist
> > >
> > >
> > >
> > > This means that programs have to check for both in exceptions, or be
> > > very sure of whether any object they are using ultimately refers to a
> > > File or a FileReference.
> > >
> > > If there isn't a good reason for having both, I think we should remove
> > > one.  Since FileDoesNotExistException is loaded first in the bootstrap
> > > process (since it is part of Files, not FileSystem), keeping it probably
> > > makes more sense.
> > >
> > > Similar duplication exists for FileAlreadyExistsException and
> > > FileExists.
> > >
> > > Thoughts?
> > >
> >
> > Hi Alistar,
> >
> > See the conversation here:
> >
> > https://pharo.fogbugz.com/f/cases/19026/Merge-FileDoesNotExist-and-FileDoesNotExistException
>
> Thanks, Cyril!
>
>
>
> On Mon, May 21, 2018 at 03:36:05PM +0200, Sven Van Caekenberghe wrote:
> > I vote for the simple names without Exception in them.
>
> On Mon, May 21, 2018 at 05:59:32PM +0300, Denis Kudriashov wrote:
> > +1
>
> Me too... :-)
>
>
> I'll work on this next.
>
> Cheers,
> Alistair
>
>
>
>
>
> --
>    
> Guille Polito
> Research Engineer
>
> Centre de Recherche en Informatique, Signal et Automatique de Lille
> CRIStAL - UMR 9189
> French National Center for Scientific Research - http://www.cnrs.fr
>
> Web: http://guillep.github.io
> Phone: +33 06 52 70 66 13


Reply | Threaded
Open this post in threaded view
|

Re: FileDoesNotExist vs FileDoesNotExistException

Denis Kudriashov

2018-05-21 21:14 GMT+03:00 Sven Van Caekenberghe <[hidden email]>:


> On 21 May 2018, at 20:07, Guillermo Polito <[hidden email]> wrote:
>
> If I'm recalling well (which I might not :)) there is one thing (that I don't quite like) that prevents these two classes to be easily merged into one: their #defaultAction.

We need a good talk/discussion about default actions.

I am pretty confused by them, and my first reaction is that I don't like them, too much UI in there.

I am 100% with you. UI queries to users should be in UI.
 

Step 1 is to define clearly what #defaultAction is, what is should do, what is allowed, what not, good practices, intended purpose, etc...

> On Mon, May 21, 2018 at 7:07 PM, Alistair Grant <[hidden email]> wrote:
> On Mon, May 21, 2018 at 03:01:57PM +0200, Cyril Ferlicot D. wrote:
> > Le 21/05/2018 ?? 14:58, Alistair Grant a ??crit??:
> > > Hi Everyone,
> > >
> > > Does anyone know the history behind FileDoesNotExist and
> > > FileDoesNotExistException?
> > >
> > > Both classes exist in 6.1, and as far as I can tell, both are intended
> > > to do the same thing, i.e. the class comments are:
> > >
> > > FileDoesNotExist;
> > >
> > > I am raised when an operation is attempted on a file that does not
> > > exist. This includes cases where a file operation is attempted on a
> > > directory.
> > >
> > >
> > >
> > > FileDoesNotExistException:
> > >
> > > Notify when fie does not exist
> > >
> > >
> > >
> > > This means that programs have to check for both in exceptions, or be
> > > very sure of whether any object they are using ultimately refers to a
> > > File or a FileReference.
> > >
> > > If there isn't a good reason for having both, I think we should remove
> > > one.  Since FileDoesNotExistException is loaded first in the bootstrap
> > > process (since it is part of Files, not FileSystem), keeping it probably
> > > makes more sense.
> > >
> > > Similar duplication exists for FileAlreadyExistsException and
> > > FileExists.
> > >
> > > Thoughts?
> > >
> >
> > Hi Alistar,
> >
> > See the conversation here:
> >
> > https://pharo.fogbugz.com/f/cases/19026/Merge-FileDoesNotExist-and-FileDoesNotExistException
>
> Thanks, Cyril!
>
>
>
> On Mon, May 21, 2018 at 03:36:05PM +0200, Sven Van Caekenberghe wrote:
> > I vote for the simple names without Exception in them.
>
> On Mon, May 21, 2018 at 05:59:32PM +0300, Denis Kudriashov wrote:
> > +1
>
> Me too... :-)
>
>
> I'll work on this next.
>
> Cheers,
> Alistair
>
>
>
>
>
> --
>   
> Guille Polito
> Research Engineer
>
> Centre de Recherche en Informatique, Signal et Automatique de Lille
> CRIStAL - UMR 9189
> French National Center for Scientific Research - http://www.cnrs.fr
>
> Web: http://guillep.github.io
> Phone: +33 06 52 70 66 13



Reply | Threaded
Open this post in threaded view
|

Re: FileDoesNotExist vs FileDoesNotExistException

alistairgrant
On Mon, May 21, 2018 at 09:17:24PM +0300, Denis Kudriashov wrote:

>
> 2018-05-21 21:14 GMT+03:00 Sven Van Caekenberghe <[hidden email]>:
>
>    
>
>     > On 21 May 2018, at 20:07, Guillermo Polito <[hidden email]>
>     wrote:
>     >
>     > If I'm recalling well (which I might not :)) there is one thing (that I
>     don't quite like) that prevents these two classes to be easily merged into
>     one: their #defaultAction.
>
>     We need a good talk/discussion about default actions.
>
>     I am pretty confused by them, and my first reaction is that I don't like
>     them, too much UI in there.
>
>
> I am 100% with you. UI queries to users should be in UI.

Guille, thanks for the heads-up.

I haven't thought about default actions until now, so I need to
investigate before going much further.  But having UI operations as part
of the default action seems wrong for one of the core classes.

My primary focus at the moment is to get the file attribute enhancements
I've made integrated in to Pharo:

https://pharo.fogbugz.com/f/cases/18279/isSymlink-seems-to-be-broken-on-Linux

but I'll continue to work on this at the same time.


Cheers,
Alistair