Repository navigation
Conversation
DiscFileSystem gives read-only access to the files of a disc. A drive letter or a mounted folder is read as a folder, a dump image or the device path of an optical drive on Linux is read through the ISO 9660 and UDF readers of SabreTools.Serialization, and on macOS the mount point macOS created is found with "mount". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
System detection, the submission information and the protection scan read the files of the disc through DiscFileSystem, so a disc in a drive that is not mounted is read as well. After a dump, a drive path that is not a folder is no longer scanned as one: the files of the dump image are scanned instead, writing to a temporary folder only what the scanner reads. The new "Scan Dump Image Files" option does the same for drive letters on Windows, and MPF.Check scans the dump image when --scan is given without --path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening the device of an optical drive makes the Linux kernel close the tray if it is open, and MPF opens the device to read the disc files when it starts, when a drive is selected and when the label is updated. udev keeps whether there is a disc in the drive, so the device is not opened if udev saw no disc in it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Optical drives on Linux were always marked as active, so an empty drive was selected at startup like a drive with a disc. They are now marked as active unless udev saw no disc in them, like a drive that is not ready on Windows, and udev is asked again when the drive is refreshed. The output name of an empty optical drive on Linux stays the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DriveInfo does not report the file system and size of a disc that is not mounted, so on Linux the media type could not be detected from them and the size check of the Xbox 360 detection always passed. They are now read from the disc in an optical drive when the drives are listed and when a drive is refreshed, with the readers used for its files, and named and sized as Windows reports them for a mounted disc: CDFS with the size of the ISO 9660 volume, or UDF with the size up to the end of the UDF partition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening the device of a drive with an open tray makes the kernel close the tray. udev notices an opened tray up to two seconds later, so reading the disc in that moment still closed the tray. The device is now opened with O_NONBLOCK, which leaves the tray as it is, and reads fail while there is no disc. It is still read in random order, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On macOS, the file system of a disc was left empty and its size was the size of the whole disc that diskutil reports, in raw 2352-byte sectors for a CD, so the media type was not detected. They are now read from the disc in an optical drive when the drives are listed, like on Linux, from the raw device of the whole disc, which belongs to the user logged in at the console. The devices of the single tracks belong to root, and the block device of the whole disc cannot be opened when the disc has audio tracks, as macOS mounts them on it. The raw device can only be read in whole blocks, so VolumeStream can now read whole blocks and keeps the ones it read, as reading the file system reads some sectors more than once and the raw device does not cache them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This builds on #1063, only the last commit is new. It uses the udev check that #1063 added.
On Windows, MPF marks a drive that is not ready as inactive, so a drive with a disc is selected first. On Linux, every optical drive was marked as active, so an empty drive was selected like one with a disc. Optical drives on Linux are now marked as active unless udev saw no disc in them, and
RefreshDriveasks udev again, as it readsIsReadyagain on Windows.GetUnixBlockDevicemoved toDrive, so that thesgdevices are checked through theirsrdevice.Measured on Linux with a USB Plextor PX-760A and two empty drives:
srandsgdevices are the only ones marked as active. Before, all six were. The output names are the same as before.IsReadyof the same drive became true 11.8 s after closing the tray.Nothing changes on macOS, where a drive without a disc has no
/dev/disknode and is not listed.Prepared with AI assistance (Claude Opus 5.5) and reviewed before submission.