Running platform: CentOS requirement: Similar to optvirtual. file: opt1.fileopt2. fileopt3.file first, I know the merge command, but this will create a new file and occupy space. what I want is to access optvirtual. file, equivalent to system motion... running platform: CentOS
Requirement: similar
/opt/virtual.file
Point:/opt/1.file
/opt/2.file
/opt/3.file
First, I know the merge command, but this will create a new file and occupy space.
What I want is access/opt/virtual.file
Is equivalent to dynamically merging these three files into one as one for access.
This requirement is not a request to merge js/css in nginx_http_concat.
This is because files are separated by 5 MB/block to ensure stability during File Uploading. although these blocks can also be merged using programs, there is no software for the system to make virtual files, point to these parts, so you don't need to merge them.
Reply content:
Running platform: CentOS
Requirement: similar
/opt/virtual.file
Point:/opt/1.file
/opt/2.file
/opt/3.file
First, I know the merge command, but this will create a new file and occupy space.
What I want is access/opt/virtual.file
Is equivalent to dynamically merging these three files into one as one for access.
This requirement is not a request to merge js/css in nginx_http_concat.
This is because files are separated by 5 MB/block to ensure stability during File Uploading. although these blocks can also be merged using programs, there is no software for the system to make virtual files, point to these parts, so you don't need to merge them.
This must be achieved using fuse, as well as written by the great God: https://github.com/schlaile/c...
Install and compile concatfs
yum install fuse fuse-develgit clone https://github.com/schlaile/concatfs.gitcd concatfs/srcgcc -Wall concatfs.c `pkg-config fuse --cflags --libs` -o concatfscp ./concatfs /bin
Start a directory by attaching
Original Directory:
/opt/www/website/
Contains files
index.html
test.html
Create a directory to be mounted
mkdir /opt/www/website_mnt
Run
concatfs /opt/www/website/ /opt/www/website_mnt
If no error is reported, it is already running in the background.
Create a special file name including-concat-
If-concat-is included, it will be specially parsed by concatfs.
vim /opt/www/website/1-concat-.txt
Content
index.htmltest.html
Note that the ending column also requires a carriage return character LF, otherwise the last file will not be loaded.
Access Now/opt/www/website_mnt/1-concat-.txt
The merged data of these two files is returned.
These two files are dynamically merged, but they are not physically merged.
Note:website_mnt/1-concat-.txt
Directory
Accesswebsite/1-concat-.txt
Still the original file
PS: No test writes/opt/www/website_mnt/1-concat-.txt
Status