June 2000
Intermediate to advanced
556 pages
8h 45m
English
CD-ROM reference=13016.txt """ Convert the information about a filesystem or partial filesystem to XML conforming to the xFS DTD. XML Processing with Python Sean Mc Grath http://www.digitome.com """ import os,sys,glob,stat,time,copy import string def escape (s): """ Convert XML special characters to their entity reference representations. """ s = string.join (string.split (s,"<"),"&lt;") s = string.join (string.split (s,"&"),"&amp;") return s def xFS (spec,indent=1): """ Given a directory specification, generate XML from file information. Recursively process subdirectories. """ for f in glob.glob (spec): # Pick up information about the file. o = os.stat(f) # The mode value can be used to determine if this # ...
Read now
Unlock full access