简体   繁体   English

Python 检索从中复制文件的文件路径

[英]Python retrieve filepath of where file was copied from

I'm looking for a way to retrieve the file path of where a file was copied from.我正在寻找一种方法来检索从中复制文件的文件路径。 As in, let's say I have 'FileA' in dir1, and I copy it to dir2.例如,假设我在 dir1 中有“FileA”,然后将其复制到 dir2。 Is there any way (preferably in Python) to examine the copied file in dir2 and retrieve the dir1 file path where the file was copied from?有什么方法(最好在 Python 中)检查 dir2 中的复制文件并检索从中复制文件的 dir1 文件路径?

No, you cannot do it by just examining the file in dir2.不,您不能仅通过检查 dir2 中的文件来做到这一点。 Such information can be in system or user logs or something like this but not in the destination file.此类信息可以在系统或用户日志或类似的东西中,但不在目标文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM