Overview
Comment: | Implemented basic open() and read() |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a7c7a7a363cffe0f1037e6b125b9bd76 |
User & Date: | rkeene on 2014-09-09 06:46:54 |
Other Links: | manifest | tags |
Context
2014-09-09
| ||
07:33 | Updated to create separate interpreters per thread check-in: cf4ca88d48 user: rkeene tags: trunk | |
06:46 | Implemented basic open() and read() check-in: a7c7a7a363 user: rkeene tags: trunk | |
06:46 | Updated to download files as binary check-in: d0513156ec user: rkeene tags: trunk | |
Changes
Modified appfs.c from [62dbc078fa] to [4ed6fa78a6].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | + + | #define FUSE_USE_VERSION 26 #include <sys/types.h> #include <sqlite3.h> #include <string.h> #include <stdarg.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <fuse.h> #include <tcl.h> #define APPFS_CACHEDIR "/tmp/appfs-cache" |
︙ | |||
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | + + | char name[256]; }; struct appfs_pathinfo { appfs_pathtype_t type; time_t time; char hostname[256]; union { struct { int childcount; } dir; struct { int executable; off_t size; char sha1[41]; } file; } typeinfo; }; static appfs_os_t appfs_convert_os_fromString(const char *os) { if (strcasecmp(os, "Linux") == 0) { return(APPFS_OS_LINUX); |
︙ | |||
203 204 205 206 207 208 209 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | - - + + + + + + + + + + + + + + | return(-1); } return(0); } |
︙ | |||
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | + + + + + | if (!size) { size = "0"; } if (!perms) { perms = ""; } if (!sha1) { sha1 = ""; } pathinfo->typeinfo.file.size = strtoull(size, NULL, 10); snprintf(pathinfo->typeinfo.file.sha1, sizeof(pathinfo->typeinfo.file.sha1), "%s", sha1); if (strcmp(perms, "x") == 0) { pathinfo->typeinfo.file.executable = 1; } else { pathinfo->typeinfo.file.executable = 0; } |
︙ | |||
590 591 592 593 594 595 596 597 598 599 600 601 602 603 | 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | + | if (_path[1] == '\0') { /* Request for the root directory */ sites = appfs_getsites(&sites_count); pathinfo->type = APPFS_PATHTYPE_DIRECTORY; pathinfo->typeinfo.dir.childcount = sites_count; pathinfo->hostname[0] = '\0'; if (children) { for (site = sites; site; site = site->_next) { node = (void *) ckalloc(sizeof(*node)); node->_next = *children; strcpy(node->name, site->name); *children = node; |
︙ | |||
615 616 617 618 619 620 621 622 623 624 625 626 627 628 | 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | + + | hostname = path + 1; packagename = strchr(hostname, '/'); if (packagename != NULL) { *packagename = '\0'; packagename++; } snprintf(pathinfo->hostname, sizeof(pathinfo->hostname), "%s", hostname); packages = appfs_getindex(hostname, &packages_count); if (packages == NULL || packages_count == 0) { APPFS_DEBUG("Unable to fetch package index from %s", hostname); free(path_s); |
︙ | |||
811 812 813 814 815 816 817 | 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 | - + - + - + - + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + - + + + + + + | memset(stbuf, 0, sizeof(struct stat)); stbuf->st_mtime = pathinfo.time; stbuf->st_ctime = pathinfo.time; stbuf->st_atime = pathinfo.time; if (pathinfo.type == APPFS_PATHTYPE_DIRECTORY) { |
︙ |