[Seaside] seaside hosting: trouble with assureExistenceOfPath

Avi Bryant avi at dabbledb.com
Mon Jul 16 17:58:05 UTC 2007

On 7/16/07, Nick Ager <nick.ager at gmail.com> wrote:
> Hi,
> I uploaded a test application for the first time on seasidehosting and
> am having problems creating directories under the image. All was well
> locally. The problem starts when I try to create a directory with code
> similar to:
> dir1:='dir1'.
> dir2:='dir2'.
> newDirectory := FileDirectory on: FileDirectory default fullName,
> FileDirectory slash asString, dir1.
> fixDirectory assureExistenceOfPath: dir2

I've had the same problem.  The workaround I use is a very similar
method which suppresses errors on #createDirectory:

ensureExistenceOfPath: localPath
	localPath isEmpty ifTrue: [ ^self ].
	(self directoryExists: localPath) ifTrue: [^ self].
	self containingDirectory ensureExistenceOfPath: self localName.
	[self createDirectory: localPath] ifError: []

It ain't pretty but it works.


More information about the Seaside mailing list