Skip to content

Data Retrieval Limitation When Parsing ISO and Reading a File Larger than 4GB (version = 1.2.0) #275

Open
@Charger0

Description

@Charger0
  1. Description

I've encountered a troublesome issue during the relevant operations. Currently, I'm attempting to parse an ISO file and read a file within it that is larger than 4GB. However, during this reading process, I can only obtain data with a size of around 4GB minus 2KB, and I'm unable to retrieve the entire content of this large file, which has consequently hindered the normal progress of the subsequent processing workflow.
Steps to Reproduce

  1. Preparation:
	disk, err := diskfs.OpenWithMode("1.iso", diskfs.ReadOnly)
	if err != nil {

	}

	// 
	fs, err := disk.GetFilesystem(0)
	if err != nil {


	}
	file, err := fs.OpenFile(filePath, os.O_RDONLY)

	// 获取当前位置
	originalPos, err := file.Seek(0, io.SeekCurrent)
	if err != nil {
		fmt.Printf("获取当前位置出错: %v\n", err)

	}

	// 移动到文件末尾获取大小
	endPos, err := file.Seek(0, io.SeekEnd)
	if err != nil {
		fmt.Printf("获取文件大小出错: %v\n", err)

	}
	fileSize := endPos - originalPos
	fmt.Printf("文件大小为: %d字节\n", fileSize)
  1. example : Only <4G can be analyzed

image

however,the exacted file size

      root@charger-PC:/data/home/charger/Downloads# ls -al |grep filesystem.squashfs 
      -rw-r--r--  1 charger charger 4580610048 10月 23 13:45 filesystem.squashfs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions