LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-20-2011, 10:20 AM   #1
altoz
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Rep: Reputation: 0
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.
 
Old 04-20-2011, 10:25 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 04-20-2011, 10:31 AM   #3
altoz
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Original Poster
Rep: Reputation: 0
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.
 
Old 04-20-2011, 10:37 AM   #4
rforth
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is multiple owners of a single file possible? can user1 own a file that root also own dave247 Debian 3 10-09-2008 04:53 AM
Multiple Core Pointers in xorg.conf file ? srfpala Linux - Hardware 1 12-08-2006 04:00 PM
Copying a single file to multiple directories quest49 Linux - Software 6 12-04-2006 08:07 AM
Adding Multiple Files In A Single Gz File onacorpuscle Linux - Newbie 3 08-31-2006 03:18 AM
Copying a single file to multiple directories tgolly Linux - Newbie 3 04-26-2004 03:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration