Creating Linux DIR From Zope
Good morning all, Does anyone knows how to create a linux directory from Zope? Thanks, Mike
use an external method import os def make_dir(path): os.mkdir(path) -kapil --- "Tran, Mike" <mtran@shufflemaster.com> wrote:
Good morning all,
Does anyone knows how to create a linux directory from Zope?
Thanks,
Mike
__________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
On Wed, May 29, 2002 at 08:26:30AM -0700, Tran, Mike wrote:
Good morning all,
Does anyone knows how to create a linux directory from Zope?
If you mean create a new empty directory on the filesystem, you'll have to do it in a python Product or (easier) an External Method. Through-the-web code such as DTML methods and Python Scripts are not allowed to modify the filesystem; that's considered a security hazard. The relevant code in your product or method would be: import os os.mkdir("/full/path/to/new_directory_name", 0644) (The octal mode is optional.) One more note: If you do some processing on the path, it's better to use all the good stuff in the os.path library instead of just using plain strings with hard-coded path separators. That way, if you ever need to move to another system (e.g. some flavor of windows), all your code will still work. -- Paul Winkler home: http://www.slinkp.com "Muppet Labs, where the future is made - today!"
participants (3)
-
Kapil Thangavelu -
Paul Winkler -
Tran, Mike