Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-20-2011, 10:20 AM
|
#1
|
LQ Newbie
Registered: Apr 2011
Posts: 2
Rep:
|
multiple file pointers in a single file?
It may help to have a little background in what I'm trying to do.
I have files a, b, c and d. They're all relatively large and are served up by a static web server optimized for this purpose. I can get requests that look like this:
/abcd
/ad
/bacdac
...
Each request is basically a request for a concatenation of the files in the order of the letters. The list of possible requests is finite, but large enough that disk space will run out very quickly and be very expensive if I create all possible files via concatenation.
Is there a way to create a pointer file like abcd that is essentially a multi-file symlink that first points to a then to be then to c then to d? So if the contents of the files were as follows:
a: hello
b: there
c: whats
d: up
abcd would be "hellotherewhatsup" and db would be "upthere" and so on. Again, I don't want to create new concatenated files, I want to have some sort of multi-file symlink.
|
|
|
04-20-2011, 10:25 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
nice idea, but no, no such thing. If you are after fundamentally dynamic content, then you should look at creating it dynamically, a simple php script can provide what you're after assuming these files are only pulled via a web server. You can also easily use mod_rewrite to convert something like /files/abcd into /scripts/filejoinything.php?files=abcd to restore a very simple uri.
|
|
|
04-20-2011, 10:31 AM
|
#3
|
LQ Newbie
Registered: Apr 2011
Posts: 2
Original Poster
Rep:
|
Yea, I was hoping for some system-level solution instead of something at the web server level. These files are requested often enough there's a cpu load to consider when executing a program to do the job. That said, it looks like if there's nothing like it, that's my only solution.
|
|
|
04-20-2011, 10:37 AM
|
#4
|
LQ Newbie
Registered: Oct 2009
Posts: 10
Rep:
|
No.
Symlinks are like windows shortcuts that just link to another file, and cannot perform concatenation.
for your example to work you should probably consider the paste, join or cat commands
paste has the ability to join the lines of each file, separated by a tab by default but any delimiter can be used
join links two files together on lines with common data (like the sql join command)
and cat actually stands for con{cat}enate.
eg "cat a b" would produce
hello
there
for more information:
type either of the following for help and examples in your shell:
man paste
man join
man cat
hope that helps
Kind Regards
Richard Forth
_____________________________________
Linux+ CLA (Certified Linux Administrator)
Novell CLA (Certified Linux Administrator)
Novell DCTS (Certified Data Center Technical Specialist)
Linux Professional Institute (LPI) LPIC-1
|
|
|
All times are GMT -5. The time now is 07:18 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|