dsofile c#API / NTFS自定义文件属性 [英] dsofile c# API / NTFS custom file properties

查看:183
本文介绍了dsofile c#API / NTFS自定义文件属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种将元数据添加到文件的好方法。 dsofile.dll 适用于NTFS。元数据丢失,当一个丢弃一个FAT32共享副本(它使用NTFS隐藏流我猜)。 Microsoft Word文档包含不会丢失的元数据,他们如何做?与FAT相似,通过使用dsofile创建的所有元数据的电子邮件发送文件(以及使用Windows资源管理器手动创建的元数据)。单独的元数据文件不是一个选项。它必须与标准的Windows技术兼容。如果我向Outlook发送一个文件并将其发回,元数据不应该丢失。

(所需的元数据实际上只是一个ID)

解决方案

任何解决方案都是格式相关的。 MS OFFICE文件是(所有)复合文件,并有一个属性的地方。在某些格式(例如PE文件)中,只要将数据追加到文件末尾是安全的,如果您知道如何阅读它们以后。在ZIP文件中,您可能在目录中找到一个位置,或者只是将一个助手文件与您的数据一起添加到存档中。其他格式不能忍受这一点,你需要找到自己的方式来解决问题。实际上,文件名也可以作为你的ID的一个好的占位符。如果您需要将文件存储在某个地方,但不需要文件保持外部应用程序的可读性,则可以将它们打包到ZIP归档文件中,或者使用类似于我们的一个href =http://www.eldos.com/solfs/ =nofollow> SolFS
库。

I'm searching for a good way to add meta data to a file. dsofile.dll works fine for NTFS. The meta data is lost, when one drops a copy on a FAT32 share (it uses NTFS hidden streams I guess). Microsoft Word documents contain meta data that are not lost, how do they do it? Similiar to FAT, sending the file via E-Mail strips of all meta data created with dsofile (and also meta data created by hand with Windows Explorer). Separate meta data files are not an option. It must be compatible with standard Windows techniques. If I send someone a file with Outlook and he sends it back, the meta-data should not be lost.

(the required meta data is actually only an ID)

解决方案

Any solution would be format-dependent. MS OFfice files are (all) compound files and there's a place for properties there. In some formats (PE files, for example) it's safe to just append data to the end of the file, if you know how to read them later. In ZIP file you can probably find a place in the directory or just add a helper file with your data to the archive. Other formats can't stand this, and you'd need to find your own way at solving the problem.

Actually, file name can also be a good placeholder for your ID.

If you need to store the files somewhere but don't need the file to remain readable by outside applications, you can pack them to ZIP archive or use something like our SolFS library.

这篇关于dsofile c#API / NTFS自定义文件属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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