reflink | Cross-platform COW reflink copy of files | File Utils library

 by   nicokoch Rust Version: v0.1.1 License: No License

kandi X-RAY | reflink Summary

kandi X-RAY | reflink Summary

reflink is a Rust library typically used in Utilities, File Utils applications. reflink has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Cross-platform(!) COW reflink copy of files. Some file systems implement COW (copy on write) functionality in order to speed up file copies. On a high level, the new file does not actually get copied, but shares the same on-disk data with the source file. As soon as one of the files is modified, the actual copying is done by the underlying OS. This library supports Linux, Android, OSX, ios and Windows. As soon as other OS support the functionality, support will be added. For implementation details, visit the docs.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              reflink has a low active ecosystem.
              It has 26 star(s) with 3 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 5 open issues and 2 have been closed. On average issues are closed in 120 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of reflink is v0.1.1

            kandi-Quality Quality

              reflink has no bugs reported.

            kandi-Security Security

              reflink has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              reflink does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              reflink releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of reflink
            Get all kandi verified functions for this library.

            reflink Key Features

            No Key Features are available at this moment for reflink.

            reflink Examples and Code Snippets

            No Code Snippets are available at this moment for reflink.

            Community Discussions

            QUESTION

            Cannot assign to read only property 'current' in React useRef
            Asked 2021-Feb-05 at 18:32

            i used react useRef in functional components to get link on html object and store it in Recoil atom. For example:

            ...

            ANSWER

            Answered 2021-Feb-05 at 17:34

            You can't just pass a ref as a prop.

            Normally, a component hides its implementation so a parent component shouldn't be able to access a DOM element created by the child. But in the rare situation where you want to allow that on a component, you have to do so explicitly with forwardRef:

            Source https://stackoverflow.com/questions/66067697

            QUESTION

            Difference of FICLONE vs FICLONERANGE vs copy_file_range (for copy-on-write support)
            Asked 2021-Jan-16 at 15:16

            I wonder about an efficient way to copy files (on Linux, on a FS which supports copy-on-write (COW)). Specifically, I want that my implementation uses copy-on-write if possible, but otherwise falls back to other efficient variants. Specifically, I also care about server-side copy (supported by SMB, NFS and others), and also zero-copy (i.e. bypassing the CPU or memory if possible).

            (This question is not really specific to any programming language. It could be C or C++, but also any other like Python, Go or whatever has bindings to the OS syscalls, or has any way to do a syscall. If this is confusing to you, just answer in C.)

            It looks like ioctl_ficlonerange, ioctl_ficlone (i.e. ioctl with FICLONE or FICLONERANGE) support copy-on-write (COW). Specifically FICLONE is used by GNU cp (here, via --reflink).

            Then there is also copy_file_range, which also seems to support COW, and server-side-copy. (LWN about copy_file_range.)

            It sounds as if copy_file_range is more generic (e.g. it supports server-side-copy; not sure if that is supported by FICLONE).

            However, copy_file_range seems to have some issues. E.g. here, Paul Eggert comments:

            [copy_file_range]'s man page says it uses a size_t (not off_t) to count the number of bytes to be copied, which is a strange choice for a file-copying API.

            Are there situations where FICLONE would work better/different than copy_file_range?

            Are there situations where FICLONE would work better/different than FICLONERANGE?

            Specifically, assuming the underlying FS supports this, and assume you want to copy a file. I ask about the support of these functions for the functionality of:

            Are they (FICLONE, FICLONERANGE, copy_file_range) always performing exactly the same operation? (Assuming the underlying FS supports copy-on-write, and/or server-side copy.)

            Or are there situations where it make sense to use copy_file_range instead of FICLONE? (E.g. COW only works with copy_file_range but not with FICLONE. Or the other way around. Or can this never happen?)

            Or formulating the same question differently: Would copy_file_range always be fine, or are there situations where I would want to use FICLONE instead?

            Why does GNU cp use FICLONE and not copy_file_range? (Is there a technical reason, or is this just historic?)

            Related: GNU cp originally did not use reflink by default (see comment by the GNU coreutils maintainer Pádraig Brady). However, that was changed recently (this commit, bug report 24400), i.e. COW behavior is the default now (if possible) (--reflink=auto).

            Related question about Python for COW support.

            Related discussion about FICLONE vs copy_file_range by Python developers. I.e. this seems to be a valid question, and it's not totally clear whether to use FICLONE or copy_file_range.

            Related Syncthing documentation about the choice of methods for copying data between files, and Syncthing issue about copy_file_range and others for efficient file copying, e.g. with COW support. It also suggests that it is not so clear that FICLONE would do the same as copy_file_range, so their solution is to just try all of them, and fallback to the next, in this order: ioctl (with FICLONE), copy_file_range, sendfile, duplicate_extents, standard.

            Related issue by Go developers on the usage of copy_file_range. It sounds as if they agree that copy_file_range is always to be preferred over sendfile.

            (Question copied from here but I don't see how this is too less focused. This question is very focused and asks a very specific thing (whether FICLONE and copy_file_range behave the same), and should be extremely clear. I formulated the question in multiple different ways, to make the question even more clear. This question is also extremely well researched, and should already be very valuable to the community as-is with all the references. I would have been very happy if I would have found such a question by itself, even without answers, when I started researching about the differences between FICLONE and copy_file_range.)

            ...

            ANSWER

            Answered 2020-Dec-31 at 09:15

            See the Linux vfs doc about copy_file_range, remap_file_range, FICLONERANGE, FICLONE and FIDEDUPERANGE.

            Then see vfs_copy_file_range. This first tries to call remap_file_range if possible.

            FICLONE calls ioctl_file_clone (here), and FICLONERANGE calls ioctl_file_clone_range. ioctl_file_clone_range calls the more generic ioctl_file_clone (here). ioctl_file_clone calls vfs_clone_file_range (here). vfs_clone_file_range calls do_clone_file_range and that calls remap_file_range (here).

            I.e. that answers the question. copy_file_range is more generic, and anyway tries to call remap_file_range (i.e. the same as FICLONE/FICLONERANGE) first internally.

            I think the copy_file_range syscall is slightly newer than FICLONE though, i.e. it might be possible that copy_file_range is not available in your kernel but FICLONE is.

            In any case, if copy_file_range is available, it should be the best solution.

            The order done by Syncthing (ioctl (with FICLONE), copy_file_range, sendfile, duplicate_extents, standard) makes sense.

            Source https://stackoverflow.com/questions/65505765

            QUESTION

            Running Python Script Inside Bash Not Working When In Crontab
            Asked 2020-Nov-08 at 06:35

            Hi guys I would like to ask for some help with my bash script. I am running 2 python script inside my bash script and it is working when I'm running it manually but when I'm using cron only the commands in the .sh file is working not on .py

            Please take note that I already install necessary utils and packages for python3.

            This is the script:

            ...

            ANSWER

            Answered 2020-Aug-07 at 09:57

            Your PATH looks wrong:

            Source https://stackoverflow.com/questions/63294775

            QUESTION

            How to make XFS quotas work in Kubernetes volumes on DigitalOcean?
            Asked 2020-Nov-02 at 14:44

            I need help with making the XFS quotas work in Kubernetes on DigitalOcean.

            My problem essentially is that the xfs_quota tool seems to work only when one has also an access to the disk device, not only to the mounted volume. However, whatever I try, I can't seem to get access both to the device and the mount.

            I tried both volume mounts and raw block volumes.

            Volume Mounts

            Here's my storage class:

            ...

            ANSWER

            Answered 2020-Nov-02 at 14:44

            Timo here from the Managed Kubernetes (DOKS) team at DigitalOcean.

            What you are missing is the host system mount of the /dev directory. If you add both

            Source https://stackoverflow.com/questions/64525271

            QUESTION

            brackets cannot be displayed correctly in hexo blog
            Asked 2020-Sep-01 at 04:30

            I tried to build a personal blog using Github page and hexo. I am using matery theme. However, brackets in the code area cannot be displayed correctly in hexo blog. Instead, it is shown {. I am not sure what changes I made. The code now looks like this.

            ...

            ANSWER

            Answered 2020-Sep-01 at 04:30

            QUESTION

            Use HTML::TreeBuilder in Perl to extract all instances of a specific span class
            Asked 2020-Jun-07 at 08:10

            Trying to make a Perl script to open an HTML file and extract anything contained within tags.

            Sample HTML:

            ...

            ANSWER

            Answered 2020-Jun-07 at 08:09

            in your foreach-loop you have to look down from the element you found. So the correct code is:

            Source https://stackoverflow.com/questions/62240308

            QUESTION

            tooltip isnt working when Copytoclipboard in javascript
            Asked 2020-Jan-15 at 22:06

            I want to be able to copy "reflink" on a button click with a tooltip to pop up after "reflink" was copied

            This is my code

            ...

            ANSWER

            Answered 2020-Jan-15 at 22:06

            I guess your adapting code from here: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_copy_clipboard2 and they're using an input field as the source to copy and its ID is copyText, so you should use your source to get that value, reflink

            Source https://stackoverflow.com/questions/59759825

            QUESTION

            RVest: Fixing "Replacement has lenght zero" Error in a loop
            Asked 2019-Nov-04 at 11:48

            i would like to scrape a specific bit of html-code out of a website. The desired object isn't on every page of the loop below, therefore, some values are NA. But whenever an object is missing, the whole loop stops.

            I tried this code for non-loop scraping, which turned out to work perfectly. Here i excluded all values that are either unobtainable or not of interest.

            BJ <- data.frame( Wohnungs_ID = ID, Baujahr = ifelse (nchar(Baujahr)==0 | nchar(Baujahr)>6, NA, Baujahr), stringsAsFactors = F

            In the relevant case, i want to scrape two specific variables, that are not always listed. Url is the list of reflinks i scraped ealier.

            ...

            ANSWER

            Answered 2019-Nov-04 at 11:47

            Use this instead of the loop:

            Source https://stackoverflow.com/questions/58692418

            QUESTION

            how to use a proxy with in htmlagilitypack
            Asked 2019-Aug-08 at 08:26

            I need to use a proxy with htmlagilitypack. I give a link to my app RefURL . After that I want the app get url from a proxy address . for instance "101.109.44.157:8080"

            I searched and found out this:

            ...

            ANSWER

            Answered 2019-Aug-08 at 08:26

            The proxy IP is not responding but also you're not passing web proxy in this code line:

            Source https://stackoverflow.com/questions/48851890

            QUESTION

            Copy acceleration with copy_file_range
            Asked 2019-Jan-23 at 23:59

            I'm learning about in-kernel data transferring between two file descriptors in Linux and came across something I cannot understand. Here is the quote from copy_file_range manpage

            copy_file_range() gives filesystems an opportunity to implement "copy acceleration" techniques, such as the use of reflinks (i.e., two or more i-nodes that share pointers to the same copy-on-write disk blocks) or server-side-copy

            I used to think of index nodes as something that is returned by stat/statx syscall. The st_ino type is typedefed here as

            ...

            ANSWER

            Answered 2019-Jan-23 at 23:59

            According to my understanding the fact that copy_file_range do not need to pass the data through the user-mode means the kernel doesn't have to load the data from the disk at all (it still might but it doesn't have to) and this allows further optimization by pushing the operation down the file-system stack. This covers the case of the server-side-copy over NFS.

            The actual answers about the other optimization starts with an intro into how files are stored, you may skip it if you already know that.

            There are 3 layers in how files are stored in a typical Linux FS:

            1. The file entry in some directory (which is itself a file containing a list of such entries). Such entry essentially maps file name to some inode. It is done by storing the inode-number aka st_ino which is effectively a pointer to the inode in some table.

            2. The inode that contains some shared (see further) metadata (as the one returned by stat) and some pointer(s) to data block(s) that store the actual file contents.

            3. The actual data blocks

            So for example a hard-link is a record in some directory that points to the same inode as the "original" file (and incrementing the "link counter" inside the inode). This means that only file names (and possibly directories) are different, all the rest of the data and meta-data is shared between hard-links. Note that creating a hard link is a very fast way to copy a file. The only drawback is that both files now are bound to share their contents forever so this is not a true copy. But if we used some copy-on-write method to fix the "write" part, it would work very nice. This is what some FSes (such as Btrfs) support via reflinks.

            The idea of this copy-on-wrote trick is that you can create a new inode with new appropriate metadata but still share the same data blocks. You also add cross-references between the two inodes in the "invisible" part of the inode metadata so they know they share the data blocks. Obviously this operation is very fast comparing to the real copying. And again as long as the files are only read, everything works perfectly. But unlike hard-link we can deal with writes treating them as independent as well. When some write is performed, the FS checks if the file (or rather the inode) is really the only owner of the data blocks and else copies the data before writing to it. Depending on the FS implementation it can copy the whole file on the first write or it can store some more detailed metadata and only copy the blocks that have to be modified and still share the rest between the files. In the later case blocks might not need to be copied at all if the write size is more than a block.

            So the simplest trick copy_file_range() can do is to check if the whole file is actually being copied and if so, to perform the reflink trick described above (obviously if the FS supports it).

            Some more advanced optimizations are also possible if the FS supports more detailed meta-data on data blocks. Assume you copy first N bytes from the start of the file into a new file. Then the FS can just share the starting blocks and probably has to copy only the last one that is not fully copied.

            Source https://stackoverflow.com/questions/54302260

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install reflink

            You can download it from GitHub.
            Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/nicokoch/reflink.git

          • CLI

            gh repo clone nicokoch/reflink

          • sshUrl

            git@github.com:nicokoch/reflink.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular File Utils Libraries

            hosts

            by StevenBlack

            croc

            by schollz

            filebrowser

            by filebrowser

            chokidar

            by paulmillr

            node-fs-extra

            by jprichardson

            Try Top Libraries by nicokoch

            fastcopy

            by nicokochRust

            secret-rs

            by nicokochRust

            termsize-rs

            by nicokochRust

            vulkan-driver

            by nicokochRust

            renders

            by nicokochRust