[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

RE: Automagical Directory Creation?




Many folks very likely use make(1) to run wml; and hence use make to
create directories, as in: (abstracted from my makefile; not tested!)

% cat Makefile
#----------
targ = /home/www/release/
src  = /home/www/source/
dirs = $(targ) $(addprefix $(targ), Company Products Jobs)

release: $(dirs) $(HTML)

GDEP = Makefile
HTMLS = index.html Products/product.html Company/company.html \
        Jobs/jobs.html 
HTMLR = $(addprefix $(targ), $(HTML))
WMLOPTS= -q -DROOT~.
WMLSLICE=

$(HTMLR): $(targ)/% : src/% $(GDEP)
	(cd src; wml ../$< $(WMLOPTS) $(WMLSLICE) --o ../$@ )
$(dirs) : 
	-mkdir -m 755 -p $@
#----------

Then you put all your .wml files in the /home/wml/source/ directory
tree, and when you type make, wml goes there and creates the .html
files in the /home/www/release/ tree, making any directories as
needed.



Axel Beckert writes:
 > Hi!
 > 
 > One question or feature request:
 > 
 > Is there an easy way to let WML create the directory, in which the
 > target HTML file should got to, if that directory doesn't exist? (This
 > makes only sense, if you use e.g. <lang:star:slice: /target-path> to
 > set the directory where the target file should reside in.) I didn't
 > find anything about such a feature in the documentation or faq.
 > 
 > Before we (means my employer) started using WML, we had a self-written
 > and not very flexible C++ program to combine templates and content.
 > The target directory was given in the header section of the content
 > file. If the directory didn't exist, this program created the
 > necessary hierachy. Just because all people here are used to have all
 > content files in one directory and let them create HTML files in the
 > whole web tree, we continued with this policy after we changed to WML.
 > 
 > But with WML I get always error messages like "cannot load
 > /home/www/htdocs/About/Addresses/index.de.html for unprotection at
 > /usr/local/bin/wml line 720." if some directory does not exist. (In
 > that case, /home/www/htdocs/About/ had no subdirectories...)
 > 
 > Were I just blind? If not, I would appreciate, if such a (IMHO very
 > useful) feature could be offered in future releases of WML.
 > 
 > Because of this automagical directory creation usually is done
 > silently, there should be a switch, which enables or disables this
 > feature. And of course, the default should be not to create any
 > directories.
 > 
 > (For a long time, we had two directories called organisations and
 >  organizations and thought that there were just one. Reason was a typo
 >  in one of the content files.)
 > 
 > 		Regards, Axel
 > -- 
 > Axel Beckert - abe@cs.uni-sb.de - http://abe.home.pages.de/
 > Student of Computer Science, University of Saarland (Germany)
 > Artificial Intelligence Laboratory (AI Lab), Prof. Dr. W. Wahlster;
 > WWW-Administrator IBFI Schloss Dagstuhl; Students Representative
 > ______________________________________________________________________
 > Website META Language (WML)                www.engelschall.com/sw/wml/
 > Official Support Mailing List                   sw-wml@engelschall.com
 > Automated List Manager                       majordomo@engelschall.com
 > 
 > 
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com