Yes but why ensureCreateFile then ?
Why don't we juste create a message createFile as there is createFolder ?
createFolder : create the folder
createFile : create the file

ensureCreateFolder : create the folder and its parents if necessary
ensureCreateFile : create the file and its parents if necessary

2016-04-21 9:46 GMT+02:00 Peter Uhn��k <i.uhnak@gmail.com>:
At least in unix creating files and folders are different operations (mkdir/touch, rm/rmdir).

And even though it may seem convenient I would argue that it will create unintentional issues ��� if you have incorrect folder it will silently create errornous structure on the disk instead of throwing error. Imho overloading ensureCreateFile is bad.

But there's nothing stopping you from extending AFR and adding an extra method:

AbstractFileReference>>ensureCreateFileAndDirectory
"Create if necessary a folder and file for the receiver."

self parent ensureCreateDirectory.
self ensureCreateFile


Peter

On Wed, Apr 20, 2016 at 6:16 PM, Denis Kudriashov <dionisiydk@gmail.com> wrote:
I would call error

2016-04-20 17:13 GMT+02:00 Valentin Ryckewaert <valentin.ryckewaert@gmail.com>:
Hi,

I would like to have your opinion about what you want ensureCreateFile to do.
According to me ensureCreateFile should do the same thing as ensureCreateDirectory + create the file in the last directory given but in its implementation if the parents of this file doesn't exist we get an Exception.

Is it wanted or an error?��

Valentin.