是否存在允许流式传输写锁定 UTF8 文件的 DCOM 公开对象?

发布于 2024-07-18 08:06:45 字数 877 浏览 6 评论 0 原文

Scripting.FileSystemObject TextStream 对象支持Windows 风格的 Unicode 和“纯文本”由系统代码页修改,但似乎不支持 UTF8——但是,它实际上可以流式传输锁定更新的文件,例如 IIS 日志文件。

ADODB.Stream 支持 UTF-8(或原始二进制),但不支持“LoadFromFile”是一个已锁定更新的文件,尽管该文件可以在记事本等程序中打开。 (导致错误:无法打开 ADODB.Stream 文件。错误代码为 0x800a0bba)-- 尽管尝试在“读取”模式或“共享”模式下打开流,但仍然如此。 似乎服务器端 COM 对象需要比我实际请求的更多的锁定。

还有其他选择吗? 我通过 DCOM 远程调用这些,但是即使在主机系统本身上进行测试也会导致相同的行为。

理想情况下,会有一个组件充当流(即支持查找机制),可以流式传输原始字节(二进制),也可以处理纯文本、Unicode 和 UTF-8,并且可以读取打开用于写入的文件。 有人知道这样的野兽吗?

The Scripting.FileSystemObject TextStream object supports Windows style Unicode and 'plain text' modified by the system codepage, but does not appear to support UTF8 -- However, it can actually stream files that are locked for updates, such as an IIS logfile.

ADODB.Stream supports UTF-8 (or raw binary), but will not "LoadFromFile" a file that has been locked for updating, despite the file being openable in, say, notepad. ( Results in the error: ADODB.Stream File could not be opened. with an error code of 0x800a0bba ) -- This despite trying to open the stream in "Read" mode or "Shared" mode. Seems as though the server-side COM object demands more locking than I actually request it to.

Are there any other alternatives? I am invoking these remotely via DCOM, however even testing on the host system itself results in the same behaviour.

Ideally there would be a component that would act as a stream (i.e. support seek mechanisms), can either stream the raw bytes (binary) or can handle plain text, Unicode, and UTF-8, and can read files that are open for writing. Anyone know of such a beast?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

り繁华旳梦境 2024-07-25 08:06:45

我不确定这就是您要找的,但您可以构建自己的服务器端流媒体,请查看 IPipeByte。 它是自 win2k 以来就存在的接口,可让您轻松地在客户端和服务器之间传输字节。 由于您将实际读取文件,因此权限问题将只是操作系统强加给您的问题。 当然,文本格式根本不是问题。

有一篇关于使用管道的好文章,可以在此处找到。 示例代码缺失,但可能可以在离线 MSDN 中找到。

I'm not sure this is what you're looking for, but you can built your own server-side streamer, take a look at IPipeByte. It is an interface that exists since win2k, and will allow you to easily stream bytes between the client and the server. Since you'll be doing the actual reading from the file, the permissions issues are going to be only the ones that the OS imposes on you. And, of course, the text format will not be an issue at all.

There's a good article about using pipes, which can be found here. The example code is missing, but it could probably be found in offline MSDN.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文