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.