Updated project files for 0.6.5 release version.
diff --git a/diskio-unix.cc b/diskio-unix.cc
index e955739..7d24301 100644
--- a/diskio-unix.cc
+++ b/diskio-unix.cc
@@ -34,7 +34,9 @@
realFilename = userFilename;
} // DiskIO::MakeRealName()
-// Open the currently on-record file for reading
+// Open the currently on-record file for reading. Returns 1 if the file is
+// already open or is opened by this call, 0 if opening the file doesn't
+// work.
int DiskIO::OpenForRead(void) {
int shouldOpen = 1;
@@ -49,10 +51,11 @@
if (shouldOpen) {
fd = open(realFilename.c_str(), O_RDONLY);
if (fd == -1) {
- cerr << "Problem opening " << realFilename << " for reading! Error is " << errno << "\n";
- if (errno == EACCES) { // User is probably not running as root
+ cerr << "Problem opening " << realFilename << " for reading! Error is " << errno << ".\n";
+ if (errno == EACCES) // User is probably not running as root
cerr << "You must run this program as root or use sudo!\n";
- } // if
+ if (errno == ENOENT)
+ cerr << "The specified file does not exist!\n";
realFilename = "";
userFilename = "";
isOpen = 0;
@@ -105,7 +108,7 @@
// Returns block size of device pointed to by fd file descriptor. If the ioctl
// returns an error condition, print a warning but return a value of SECTOR_SIZE
-// (512)..
+// (512). If the disk can't be opened at all, return a value of 0.
int DiskIO::GetBlockSize(void) {
int err = -1, blockSize = 0;
@@ -134,6 +137,7 @@
if ((errno != ENOTTY) && (errno != EINVAL)) {
cerr << "\aError " << errno << " when determining sector size! Setting sector size to "
<< SECTOR_SIZE << "\n";
+ cout << "Disk device is " << realFilename << "\n";
} // if
} // if (err == -1)
} // if (isOpen)