Re: getting absolute directory path?
- From: "Peter H. Coffin" <hellsop@xxxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 08:34:57 -0500
On Tue, 29 Apr 2008 19:02:19 -0700 (PDT), lawpoop@xxxxxxxxx wrote:
On Apr 29, 9:32 am, "Peter H. Coffin" <hell...@xxxxxxxxxxxxx> wrote:
Shell filename globbing frequently expands into a list of filenames that
are stored in the command buffer, which generally has SOME kind of a
cap. Mostly I've seen 32k, but that'll vary. If your list of filenames
expands out past the cap, you'll get an "Arguement list too long" error
and nothing will happen. find(1) works around that, but it allows
operations on files individually, not as aggregate.
OK, this is starting to make sense as a difficulty in management.
What, then, would be an appropriate directory structure? Start putting
files that being with 'a' under the a/ directory? How do you handle
linking in the website then?
That's a common way to arrange Very Large Collections of files. And it
extends nicely horizontally (aa/ ab/ ac/ etc) as well as vertically
(a/a/ a/b/ a/c/). As far as site linking goes, you're generally dealing
with automated (by php or whatever) management of files by the point you
get to more than a few hundred anyway, so you can just automate the
references as well...
$catalog_image_thumb_path = substr($catalog_item_id,1,1) .
"/" .
$catalog_item_id;
print "<td><a href="http://example.com/show_item?id=$item_id'><img src='$catalog_image_thumb_path'></a></td>";
If too many files for the command buffer is what's preventing me from
using a wildcard , then I could do the same results by doing something
like '$> command a*; command b*;' etc.
Sometimes. It depends on what you're trying to do. If you're trying to
do an operation to each file, you're okay. If you're trying to (for
example) get a count of the total number of lines that refer to a
particular included module in all the .c files in a massive directory
but not in the .php files, that may be a bit more of a challenge.
Or, do I create directories and organize them thematically, according
to the functions of the website, such as 'new_customer_signup'? What
happens when that directory gets too many files in it?
It seems to me, that if the website is has grown so much that there
are too many files in the root directory, so much so that you can't
properly run commands on it, that a website is not the right solution
for the problem. There's a flaw in the design somewhere, and the
number of files in the root directory is a symptom of it.
Often it's a problem. Sometimes it's a matter of growth outstripping the
time available to rework a functioning site.
I'm willing to see the other side of this, but so far I can't think of
an instance where a file management task I'm doing on the command line
is going to be more cumbersome within a single directory than across
and into multiple subdirectories. Is wildcarding the only problem?
*grin* It's probably not, but it's the one I've run into more than once,
and it's the one that was primative enough to be a recurring problem
rather than a "solve it once by applying more technology" situtation.
--
It's not hard, it's just asking for a visit by the fuckup fairy.
-- Peter da Silva
.
- Follow-Ups:
- Re: getting absolute directory path?
- From: lawpoop
- Re: getting absolute directory path?
- From: Captain Paralytic
- Re: getting absolute directory path?
- References:
- getting absolute directory path?
- From: lawpoop
- Re: getting absolute directory path?
- From: C. (http://symcbean.blogspot.com/)
- Re: getting absolute directory path?
- From: lawpoop
- Re: getting absolute directory path?
- From: Peter H. Coffin
- Re: getting absolute directory path?
- From: lawpoop
- Re: getting absolute directory path?
- From: Peter H. Coffin
- Re: getting absolute directory path?
- From: lawpoop
- getting absolute directory path?
- Prev by Date: Re: iframe shows in Mozilla, but not in IE
- Next by Date: Re: Compression Functions
- Previous by thread: Re: getting absolute directory path?
- Next by thread: Re: getting absolute directory path?
- Index(es):