Re: Overwriting copy functionality in filesystem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!

On 23/03/2019 17:59, Bharath Vedartham wrote:
[..]
> I was wondering how we can overwrite the copy functionality while
> writing our own filesystem in linux. 
> VFS does not offer any sort of API for copy. I think it calls create and

Yes.

> write when we execute the copy the file/dir.
> I am interested in overwriting the way copy happens in my
> filesystem(which I am writing for fun :p). 
> Any ideas?

strace a "cp" and see which system calls are used.
Look into the source code and see how it's implemented.

There is actually more than one method but the usual (while simplest,
most versatile and probably fastest) method used is: open source and
destination files, read from the source, write into the destination
until EOF.

MfG,
	Bernd
-- 
Bernd Petrovitsch                  Email : bernd@xxxxxxxxxxxxxxxxxxx
                     LUGA : http://www.luga.at

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux