Can anyone tell me how to create a subdirectory programmatically under a LocalFS folder? I have a LocalFS folder called images. When I add a new promoter to my site, I'd like to automatically add a directory that would hold that promoter's images. If the promoter's ID number is 187, I want to create a subdirectory '187' under images/Companies/100. Jeff Nielsen / UgoFast http://www.UgoFast.com Jeff@UgoFast.com
Jeff Nielsen / UgoFast writes:
Can anyone tell me how to create a subdirectory programmatically under a LocalFS folder? I have a LocalFS folder called images. When I add a new promoter to my site, I'd like to automatically add a directory that would hold that promoter's images. If the promoter's ID number is 187, I want to create a subdirectory '187' under images/Companies/100. Can you do it in ZMI?
If yes, look at its code. It does it programmatically! Dieter
Dieter, I don't think I'm understanding you. I want to create the subdirectory programmitcally inside a DTML Document. Are you suggesting something like: <dtml-call "/images/Companies/100/manage_addProduct/OFSP/folderAdd(187)"> or <dtml-call "/images/Companies/100/manage_addProduct/LocalFS/folderAdd(187)"> (Neither one works. I tried them.) Do I need a more recent version of LocalFS? I'm using v0.9.6 (I think). It doesn't appear that v0.10.1 addressed this kind of thing. Jeff -----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: Tuesday, September 25, 2001 2:29 PM To: Jeff Nielsen / UgoFast Cc: zope-dev@zope.org Subject: Re: [Zope-dev] Create directory in LocalFS Jeff Nielsen / UgoFast writes:
Can anyone tell me how to create a subdirectory programmatically under a > LocalFS folder? I have a LocalFS folder called images. When I add a new > promoter to my site, I'd like to automatically add a directory that > would hold that promoter's images. If the promoter's ID number is 187, I > want to create a subdirectory '187' under images/Companies/100. Can you do it in ZMI?
If yes, look at its code. It does it programmatically! Dieter
On Tue, 25 Sep 2001, Jeff Nielsen / UgoFast wrote:
I don't think I'm understanding you. I want to create the subdirectory programmitcally inside a DTML Document. Are you suggesting something like:
<dtml-call "/images/Companies/100/manage_addProduct/OFSP/folderAdd(187)">
OFSP is Zope's Object File System Product. So no, you wouldn't be using one of its methods to create a subfolder in a LocalFS folder. What Dieter was asking/suggesting, is that you look at LocalFS's management system. *If* it has a way of creating a subdirectory inside a LocalFS folder, then you could just take a peak at how it does it, to find out how to code it yourself in your own product. If, however, LocalFS does *not* have a way of creating a subdirectory through its management interface, then you'll probably need to write an external method that uses python file system library functions to create the subdirectory. I've never looked at LocalFS, so I don't know if that would be enough, or if you'd also have to call some LocalFS routines to let it know that the subdirectory now exists. --RDM
when you're inside a LocalFS "folder", you can add a directory by simply adding a "folder", but obviously you need the permissions to create a directory in the FS (i.e. the Zope/Apache process needs the permissions)... cheers, Garry On 26 Sep 2001, at 11:59, R. David Murray wrote: From: "R. David Murray" <bitz@bitdance.com> To: Jeff Nielsen / UgoFast <Ugo@speakeasy.net> Copies to: <zope-dev@zope.org> Subject: RE: [Zope-dev] Create directory in LocalFS Date sent: Wed, 26 Sep 2001 11:59:32 -0400 (EDT)
On Tue, 25 Sep 2001, Jeff Nielsen / UgoFast wrote:
I don't think I'm understanding you. I want to create the subdirectory programmitcally inside a DTML Document. Are you suggesting something like:
<dtml-call "/images/Companies/100/manage_addProduct/OFSP/folderAdd(187)">
OFSP is Zope's Object File System Product. So no, you wouldn't be using one of its methods to create a subfolder in a LocalFS folder.
What Dieter was asking/suggesting, is that you look at LocalFS's management system. *If* it has a way of creating a subdirectory inside a LocalFS folder, then you could just take a peak at how it does it, to find out how to code it yourself in your own product. If, however, LocalFS does *not* have a way of creating a subdirectory through its management interface, then you'll probably need to write an external method that uses python file system library functions to create the subdirectory. I've never looked at LocalFS, so I don't know if that would be enough, or if you'd also have to call some LocalFS routines to let it know that the subdirectory now exists.
--RDM
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
+-------------------------------------------+ Garry Steedman mailto:gs@styrax.com Styrax Associates http://www.styrax.com/ "The Good Man has no shape." +-------------------------------------------+
participants (4)
-
Dieter Maurer -
Garry Steedman -
Jeff Nielsen / UgoFast -
R. David Murray