如何阅读ISO文件? [英] How to read the ISO file?

查看:93
本文介绍了如何阅读ISO文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我想将ISO文件的内容读入一个字节数组。但是我写的代码无法实现这个功能。我希望我们可以提供帮助。



我的代码:

HANDLE hFile = CreateFile(E:\\ ***。 iso,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);



BYTE * rev = NULL;

rev = new BYTE [FileSize];

DWORD dwByteRead = 0;



BOOL bResult = ReadFile(hFile,rev,FileSize,&dwByteRead,0); < br $>


CloseHandle(hFile);

Hi guys!
I want to read the contents of the ISO file into an array of bytes. But I wrote the code can not realize the function. I hope that we can help.

My Code:
HANDLE hFile = CreateFile ("E:\\***.iso", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );

BYTE *rev = NULL;
rev = new BYTE [FileSize];
DWORD dwByteRead = 0;

BOOL bResult = ReadFile(hFile, rev, FileSize, &dwByteRead, 0);

CloseHandle(hFile);

推荐答案

首先,ISO仅代表国际组织标准化,严格来说,这使你的问题含糊不清。此组织标准化的任何文件类型或文件内容标准都可称为ISO文件。请参阅:

http://en.wikipedia.org/wiki/ISO [< a href =http://en.wikipedia.org/wiki/ISOtarget =_ blanktitle =New Window> ^ ]。



最有可能的是,您在谈论光盘文件系统的ISO标准,ISO 9660(ECMA-119): http:// en.wikipedia.org/wiki/ISO_9660 [ ^ ]。在这种情况下,ISO文件可能表示包含使用此文件系统写入的磁盘的完整光盘副本的文件。这是常规文件,您可以以与任何其他文件完全相同的方式阅读它。我建议使用标准C ++库,而不是使用任何特定于Windows的API:

http: //www.cplusplus.com/reference/fstream/ifstream/ [ ^ ],

http://en.wikipedia。 org / wiki / C%2B%2B_standard_library [ ^ ]。



您需要了解它无法帮助您阅读ISO 9660文件系统的文件结构及其任何文件。为此,您需要学习ISO 9660格式。请参阅:

http://www.drdobbs .com / database / inside-the-iso-9660-filesystem-format / 184408899 [ ^ ],

http://www.ecma-international.org/publications/standards/Ecma-119.htm [ ^ ]。







如果您有任何其他意义,而不是ISO 9660文件系统的文件图像,请澄清。


您的评论确认我对您的问题的理解是正确的。在ISO文件中解析ISO 9660文件系统的方法之一是:查看着名的7-Zip:

http://en.wikipedia.org/wiki/7-zip [ ^ ],

http://www.7 -zip.org/ [ ^ ]。



此产品是开源的,它可以解析它并提取文件。因此,您可以1)下载代码,学习它并理解如何提取文件,或者2)直接在项目中使用7-zip代码。



在第二种情况下,请仔细阅读许可证,以确保合法地执行,不要忘记这项工作的适当归属。



-SA
First of all, "ISO" means nothing but "International Organization for Standardization", which makes your question, strictly speaking, ambiguous. Any file type or file content standard which this organization standardize could be called "ISO file". Please see:
http://en.wikipedia.org/wiki/ISO[^].

Most likely, you are talking about ISO standard for compact disk file systems, ISO 9660 (ECMA-119): http://en.wikipedia.org/wiki/ISO_9660[^]. In this case, "ISO file" may mean the file which contains the full disc copy of the disk written using this file system. This is regular file, you can read it in exact same way as any other file. Instead of using any Windows-specific API, I would advise using standard C++ library:
http://www.cplusplus.com/reference/fstream/ifstream/[^],
http://en.wikipedia.org/wiki/C%2B%2B_standard_library[^].

You need to understand that it won't help you to read the file structure of the ISO 9660 file system and any it the files. To achieve that, you need to learn ISO 9660 format. Please see:
http://www.drdobbs.com/database/inside-the-iso-9660-filesystem-format/184408899[^],
http://www.ecma-international.org/publications/standards/Ecma-119.htm[^].



If, by any chance, you meant something else, not the file image of ISO 9660 file system, please clarify.

Your comment confirms that my understanding of your problem was correct. One of the way to parse the ISO 9660 file systems in ISO file would be this: look at the famous 7-Zip:
http://en.wikipedia.org/wiki/7-zip[^],
http://www.7-zip.org/[^].

This product is open source, and it can parse it and extract the files. So, you can either 1) download the code, learn it and understand how to extract the files, or 2) directly use the 7-zip code in your project.

In the second case, please carefully read the license, to make sure you do it legitimately, don't forget about appropriate attribution of this work.

—SA


这篇关于如何阅读ISO文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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