seaside hosting: trouble with assureExistenceOfPath

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

seaside hosting: trouble with assureExistenceOfPath

Nick
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 found a reference to a similar problem:
http://liststest.squeakfoundation.org/pipermail/seaside/2006-August/008738.html
with a fix:
http://liststest.squeakfoundation.org/pipermail/seaside/2006-August/008747.html

unfortunately I get the same walkback with the fix. ...

Any ideas?

Cheers

Nick

----

walkback:

Error: a primitive has failed
UnixFileDirectory(Object)>>error:
self UnixFileDirectory on '/'
temps
aString 'a primitive has failed'
inst vars
pathName FilePath('/')

UnixFileDirectory(Object)>>primitiveFailed
self UnixFileDirectory on '/'
temps
inst vars
pathName FilePath('/')

UnixFileDirectory(FileDirectory)>>primCreateDirectory:
self UnixFileDirectory on '/'
temps
fullPath '/service'
inst vars
pathName FilePath('/')

UnixFileDirectory(FileDirectory)>>createDirectory:
self UnixFileDirectory on '/'
temps
localFileName 'service'
inst vars
pathName FilePath('/')

UnixFileDirectory(FileDirectory)>>assureExistenceOfPath:
self UnixFileDirectory on '/'
temps
lPath 'service'
localPath 'service'
inst vars
pathName FilePath('/')
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: seaside hosting: trouble with assureExistenceOfPath

Avi Bryant-2
On 7/16/07, Nick Ager <[hidden email]> 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.

Avi
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside