How to use CDReader() when the file size is > 4.7GB

Jun 15, 2009 at 3:08 PM

The ISO is using UDF. I tried setting the Joliet bool to false but i get this error:

Year, Month, and Day parameters describe an un-representable DateTime.



Thanks in advance for your help!



Jun 15, 2009 at 10:02 PM

Hi Rick,

Can you supply a full stack trace?  I suspect discutils may be over-sensitive to the contents of some date fields found in this particular ISO.

BTW, discutils has no support for UDF format, but (I hope) should work for ISOs that contain both an ISO 9660 file system and a UDF file system.




Jun 15, 2009 at 10:12 PM

Application_ThreadException error occured. Msg: Year, Month, and Day parameters describe an un-representable DateTime.
       at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
       at DiscUtils.Iso9660.IsoUtilities.ToUTCDateTimeFromDirectoryTime(Byte[] data, Int32 offset)
       at DiscUtils.Iso9660.DirectoryRecord.ReadFrom(Byte[] src, Int32 offset, Encoding enc, DirectoryRecord& record)
       at DiscUtils.Iso9660.CommonVolumeDescriptor..ctor(Byte[] src, Int32 offset, Encoding enc)
       at DiscUtils.Iso9660.CDReader..ctor(Stream data, Boolean joliet)
       at ArchiveForm.Form.LoadISOContentToLocal(String fileWeNeed)
       at ArchiveForm.Form.btnISOFileLoad_Click(Object sender, EventArgs e)
       at ArchiveForm.Form.UpdateViewerContent()
       at ArchiveForm.Form.RestoreUI(ISOFormatter formatter)
       at ArchiveForm.Form.WrapUpCompletedEvent(RunWorkerCompletedEventArgs e)
       at ArchiveForm.Form._bgWorkerISOWriter_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
       at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
       at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)...

Jun 15, 2009 at 10:27 PM

Btw, what is the expected impact of setting joliet to false -  CDReader(theStream,false); ?

I tried it with several images and each attempt failed to read with the same error.




Jun 16, 2009 at 7:32 AM

The joliet flag just controls which of two directory structures on the ISO are used.  The joliet structure (the supplementary volume descriptor) supports unicode file names.

It looks like thre is an invalid timestamp in the supplementary volume descriptor - discutils should be better at handling these.


I'll aim to check in a fix in the next few days.



Jun 16, 2009 at 1:04 PM

Thanks, keep me posted - I'm really looking forward to it!







Jun 17, 2009 at 1:53 PM

Something curious -

I created an ISO image that includes a .csv file. When I use cd.OpenFile() to retrieve it, the output file is no longer text but garbage.


1. CSV file size - 2.65 MB (2,787,928 bytes)

2. ISO FsiFileSystems Setting - FsiFileSystemISO9660 | FsiFileSystemJoliet | FsiFileSystemUDF ( I have been testing this with CDReader(stream,true) ). I can open this iso with VCDControlTool.exe and CDReader(stream,true) succeeds - however the OpenFile call on the CSV file returns a corrupt value.

3. ISO file size -  6.48 GB (6,962,886,656 bytes)




Jun 17, 2009 at 11:34 PM

To follow up on the last note:

It *looks* like this issue with the CSV may not be a problem after all.

  1. I opened the ISO with VcdControlTool.exe
  2. Copied the CSV from the ISO to my local.
  3. Created MyNew.ISO with the file I just copied.
  4. Opened MyNew.ISO with CDReader with no problem.

Kind'a feels like somehow my image file had the problem.

I will keep you posted!





Jun 18, 2009 at 10:25 PM

I've found some bugs that would explain what you're seeing with large files.  I've checked in a couple of changes.

Can you grab the latest source, and see if your problems are solved?



Jun 18, 2009 at 11:39 PM

Will do - btw, do u have the dll's available or is building the source my only option?






Jun 19, 2009 at 8:07 AM

I've posted the DLL here:

Building the source is easy though.  Just add the DiscUtils.csproj to your solution (you don't need the other projects).



Jun 19, 2009 at 3:06 PM

Ok, tried the new binary and here is what I found:

CDReader(stream,true) worked without any issues with the 6.4GB file.

CDReader(stream,false) didn't throw an exception with the 6.4GB file, however, cd.GetDirectories() applied Windows 8.3 filename formatting to all files and directories!




Jun 19, 2009 at 4:49 PM

Hi Rick,

That's probably about right - without Joliet, the set of file name characters permitted and is very limited - so it's quite likely your authoring software put the 8.3 file names in the Primary Volume Descriptor, and put the full file names in the Supplementary Volume Descriptor (using Joliet file name rules).

You probably just want to always use CDReader(stream, true).