复制和粘贴的工作原理 [英] working principle of copy and paste

查看:645
本文介绍了复制和粘贴的工作原理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在做一个项目很长一段时间。我想知道复制和粘贴是如何工作的。计算机如何将文件从一个位置移动到另一个位置。谢谢你的帮助

解决方案

确切的细节将取决于你使用的文件系统和操作系统,但一般的想法是文件有两个部分你的硬盘:

1.组成文件的数据。

2.关于数据所在位置的一些信息,文件在逻辑目录结构中的位置等等。



这意味着移动文件既快捷又简单 - 您只需更新逻辑位置 - 但复制更复杂:您需要创建一个新文件,然后从旧文件中读取所有数据并将其写入新文件。


您没有说明您使用的语言,但在Windows .NET中将使用 剪贴板 [ ^ ]。在Win32(C / C ++)中,有一组API函数可以执行相同的操作。


感谢您的帮助。你的答案非常有帮助。

我正在进行的项目就像一个剪贴板,用户可以暂时放置他/她想要复制的文件,每当用户希望粘贴他们复制的内容时,他们只需打开剪贴板并选择他们想要复制的特定文件。

任何有关它的帮助或关于我如何去做的建议。感谢

i've been working on a project for quite some time. And i want to know how copy and paste works. How does the computer move the file from on location to another. Thank you for ur help

解决方案

The exact details would depend on the filesystem and operating system you use, but the general idea is that there are two parts to a file on your harddrive:
1. The data that makes up the file.
2. Some information about where the data is located, where the file fits in on the logical directory structure, and so forth.

This means that moving a file is quick and easy - you simply update the logical location - but copying is a bit more involved: you need to create a new file, then read all the data from the old file and write it into the new file.


You don't state what language you are using, but in Windows .NET you would use the Clipboard Class[^]. In Win32 (C/C++) there is a set of API functions which do the same.


thank you for your help. Your answers were really helpful.
The project i'm working on is gonna be like a clipboard where a user could temporarily place files he/she wants to copy and whenever the user wishes to paste what they copied, they simply open up the clipboard and select the particular file that they want to copy.
Any help with it or suggestions on how i could go about it. Thanks


这篇关于复制和粘贴的工作原理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆