如何使用应用程序跟踪SMB中的文件? [英] How do you track files in SMB with an application?

查看:147
本文介绍了如何使用应用程序跟踪SMB中的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用PHP构建了一个应用程序,该应用程序显示了用户的主目录中的所有文件,该目录也可以通过samba使用,以便您可以从windows,mac和linux中的本地资源管理器访问它。我想给每个文件一个ID,以便我可以将每个文件的标签代码如何去做?你会做文件的哈希,看看它是否相同的文件,并因此得出结论,它的相同的文件?



每当文件或文件夹被移动时,我可以触发samba发送东西吗?

解决方案

为了回答你的第一个问题,制作哈希当然可以工作。只需在文件上使用md5即可。在您的主目录中散列文件时发生冲突的可能性非常小。海事组织我会说甚至不值得一提。
这可能不用说,但是我至少要存储哈希和完整的路径,所以你可以适当地处理移动的文件,实际上做某事 / em>与文件。


I have built an application with PHP which shows all the files in the home directory of a user this directory is also available via samba so you can access it from the native explorer in windows, mac and linux. I wanted to give every file an ID so that I can asign tags to every file how would you go about doing this? Would you make hashs of the file and look whether its the same filehash and would thus conclude that its the same file?

Can I trigger samba to send out something everytime a file or folder gets moved?

解决方案

To answer your first question, making a hash would of course work. Simply using md5 on the files would be sufficient. The chances of a collision while hashing the files in your home directory are insanely small. IMO I would say not even worth mentioning. And it probably goes without saying but... I would store at least the hash and the full path, so you can deal with moved files appropriately, and actually do something with the file.

这篇关于如何使用应用程序跟踪SMB中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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