Compare commits

...

5 Commits

Author SHA1 Message Date
aynic.os 50d62741fc Write files through ipfs add 2022-12-30 18:55:14 +00:00
Alexander Mihalicyn 3d9cc9db6a Update README.md (#45)
Update installation instruction :)
2016-09-22 11:10:50 -07:00
Philip Langdale 060edaf22d Update metadata link in README.md
The old link went stale.
2014-07-11 16:03:11 -07:00
Philip Langdale 285e3c9103 Merge pull request #1 from avar/master
Fix bad grammar in a heading in README.md
2013-05-15 20:20:43 -07:00
Ævar Arnfjörð Bjarmason 77007cf1ee Update README.md
Fix bad grammar in README.md, "that could possible exist" -> "that could possibly exist".
2013-05-16 01:46:22 +03:00
2 changed files with 38 additions and 14 deletions

View File

@ -8,7 +8,16 @@ compression was impossible? You're looking at it!
πfs is dead simple to build:
Firstly, you must install autoconf, automake, libfuse packages in your system.
For example, if you have Debian try:
```sh
sudo apt-get install autotools-dev
sudo apt-get install automake
sudo apt-get install libfuse-dev
```
```sh
./autogen.sh
./configure
make
make install
@ -42,7 +51,7 @@ From here, it is a small leap to see that if π contains all possible files,
why are we wasting exabytes of space storing those files, when we could just
look them up in π!
Every file that could possible exist?
Every file that could possibly exist?
-------------------------------------
That's right! Every file you've ever created, or anyone else has created or
@ -69,7 +78,7 @@ So I've looked up my bytes in π, but how do I remember where they are?
Well, you've obviously got to write them down somewhere; you could use a piece of
paper, but remember all that storage space we saved by moving our data into π? Why
don't we store our file locations there!?! Even better, the location of our files in
π is metadata and as [we all know](http://araman-consulting.co.uk/2012/metadata-the-importance-of-being-found/)
π is metadata and as [we all know](http://datatechnologytoday.wordpress.com/2010/09/07/on-the-importance-of-metadata/)
metadata is becoming more and more important in everything we do. Doesn't it feel
great to have generated so much metadata? Why waste time with old fashioned data
when you can just deal with metadata, and lots of it!

View File

@ -179,23 +179,38 @@ static int pifs_read(const char *path, char *buf, size_t count, off_t offset,
static int pifs_write(const char *path, const char *buf, size_t count,
off_t offset, struct fuse_file_info *info)
{
int fd[2];
int ret = lseek(info->fh, offset * 2, SEEK_SET);
if (ret == -1) {
return -errno;
}
for (size_t i = 0; i < count; i++) {
short index;
for (index = 0; index < SHRT_MAX; index++) {
if (get_byte(index) == *buf) {
break;
if(pipe(fd)){
perror("pipe(2) failed");
return -1;
}
switch(fork()){
case -1:
perror("fork(2) failed");
return -1;
case 0:
// child
dup2(fd[0], STDIN_FILENO);
dup2(info->fh, STDOUT_FILENO);
close(fd[0]);
close(fd[1]);
ret = execlp("ipfs", "ipfs", "add", "-q", NULL);
if (ret == -1) {
return -errno;
}
}
ret = write(info->fh, &index, sizeof index);
if (ret == -1) {
return -errno;
}
buf++;
break;
default:
// parent
close(fd[0]);
ret = write(fd[1], buf, sizeof(buf));
if (ret == -1) {
return -errno;
}
close(fd[1]);
}
return count;