Experimental use of /dev/rdisk rather than /dev/disk on macOS,
authorCarl Hetherington <cth@carlh.net>
Mon, 27 Apr 2020 21:44:06 +0000 (23:44 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 27 Apr 2020 21:44:12 +0000 (23:44 +0200)
as there is some suggestion it is faster.

src/lib/cross.h
src/lib/cross_linux.cc
src/lib/cross_osx.cc
src/lib/cross_windows.cc

index 1145812696ddbda442bae1ef16315f6001dc53c0..d8296e21735923088c90a91e3b47c3b8db5d3ebd 100644 (file)
@@ -117,6 +117,8 @@ public:
                return _device;
        }
 
+       std::string device_for_write () const;
+
        bool mounted () const {
                return !_mount_points.empty();
        }
index 36683a0cd1cac9551a74935b32c4895b906ea99d..983dbb669ea55bb0ac9ca6c066b63122f7ca8cd8 100644 (file)
@@ -344,6 +344,13 @@ Drive::unmount ()
 }
 
 
+string
+Drive::device_for_write () const
+{
+       return device ();
+}
+
+
 void
 unprivileged ()
 {
index 6e8ef168c2c9bd84abdb1ee8ae46e9433438929e..66be376d4cc7264d26d76a8a62a7bb406f207668 100644 (file)
@@ -493,6 +493,16 @@ Drive::get ()
        return drives;
 }
 
+
+string
+Drive::device_for_write () const
+{
+       string w = _device;
+       boost::replace_all (w, "/dev/disk", "/dev/rdisk");
+       return w;
+}
+
+
 boost::filesystem::path
 config_path ()
 {
index 8ccc790d6c287e4a1b6592fe00724671b87f6c64..96c69d78086a029e3b848394b8e7e21b0dd6cc1b 100644 (file)
@@ -596,6 +596,13 @@ Drive::unmount ()
 }
 
 
+string
+Drive::device_for_write () const
+{
+       return device ();
+}
+
+
 boost::filesystem::path
 config_path ()
 {