tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: inetd enhancements - config syntax
On Jan 14, 12:21, James Browning wrote:
}
} >I also don't like the only form of include being include-a-directory;
} >in my estimation, that wires too much policy into the mechanism. I
} >would prefer to see either two include directives, one for directories
} >and one for files, or a single directive that somehow subsumes both.
} >(Two ways come to mind immediately. (A) if the argument names a file,
} >it's a file include; if a directory, a directory include. (B) to
} >include files in a directory, write something like "include dir/*" or
} >"include dir/*.conf" or something of the sort. Though there is the
} >conflict with a possible service named "include" - perhaps ".include"?)
}
} We like the idea of being able to include files along with
} directories. Our current plan is to implement directories first,
} along with files if time permits us. If we don't have time to
} implement include-a-file, then we will make sure our include-a-directory
} implementation can easily be extended to support fies in the future.
You should really start by implementing functionality to
include files as that is your base. The way to implement including
directories is to stat the item being included to see if it is a
directory, and if it is, then branch to a routine that will scan
the directory and call the file inclusion routine on each file
found (skipping . and .. of course). If the item being included
is a file, then simply make a call to the file inclusion routine.
It isn't possible to include a directory without also being able
to include a file. It is just a matter of properly modularising
the code so that the routine to include a file is separate.
}-- End of excerpt from James Browning
Home |
Main Index |
Thread Index |
Old Index