[Zope] Local FS manage_addFolder woes

Chris Withers chrisw@nipltd.com
Sat, 22 Apr 2000 19:04:04 +0100


Jonothan,

I'm trying to do the following to create a folder in a localFS object if it isn't there:

<dtml-if "not localFSobject.fileIds(folderNameVar)">
 <dtml-call "localFSobject.manage_addFolder(folderNameVar)">
<dtml-else>
 Folder exists...
</dtml-if>

The problem is that this creates the folder in the folder containing the localFS object, not in the
localFS object.

I think I agree with Stephan Richter, that this is because the localFS object doesn't have a
manage_addFolder method and so aquisition causes it to get executed on the folder containing the
localFS object.

Fair enough, so how do I do what I want to do?

The frustrating thing is that, through the management interface, I can do exactly what I want in
exactly the same way I'd do it with any other folder: add folder -> fill in form -> hit button.
This suggests that I should be able to do an add folder in the same way programatically as I would
for a normal folder.

So:

1. Would the above work if localFSobject was a normal folder (ie is my method screwed in the first
place ;-)

2. How should I be doing what I'm trying to do, with a local FS object?

Many thanks, and it's still an amazing product even with these little niggles (which I'd guess are
more my fault for not knowing how to do what I want to do, even on a normal folder ;-)

Chris