Index: trunk/Serial_Server/library/File.h
===================================================================
--- trunk/Serial_Server/library/File.h	(revision 224)
+++ trunk/Serial_Server/library/File.h	(revision 225)
@@ -18,10 +18,14 @@
 {
 public:
-	void Create( char *p_name )
+	int Create( char *p_name )
 	{
 		fp = fopen( p_name, "r" );
 
 		if( fp )
-			log( -1, "Create Failure: '%s' already exists", p_name );
+		{
+			log( 0, "'%s' file already exists", p_name );
+			fclose( fp );
+			return( 0 );
+		}
 		
 		if( !(fp = fopen( p_name, "w" )) )
@@ -29,4 +33,6 @@
 
 		name = p_name;
+		
+		return( 1 );
 	}
 
Index: trunk/Serial_Server/library/FlatImage.h
===================================================================
--- trunk/Serial_Server/library/FlatImage.h	(revision 224)
+++ trunk/Serial_Server/library/FlatImage.h	(revision 225)
@@ -30,16 +30,16 @@
 			sizef = size / 2048.0;   // 512 byte sectors -> MB
 
-			cf.Create( name );
-
-			memset( &buff[0], 0, 512 );
-			while( size-- )
-				cf.Write( &buff[0], 512 );
-		
-			if( p_cyl > 1024 )
-				log( 0, "Created file '%s', size %.1lf MB", name, sizef );
-			else
-				log( 0, "Created file '%s', geometry %u:%u:%u, size %.1lf MB", name, p_cyl, p_sect, p_head, sizef );
-
-			cf.Close();
+			if( cf.Create( name ) )
+			{
+				memset( &buff[0], 0, 512 );
+				while( size-- )
+					cf.Write( &buff[0], 512 );
+				
+				if( p_cyl > 1024 )
+					log( 0, "Created file '%s', size %.1lf MB", name, sizef );
+				else
+					log( 0, "Created file '%s', geometry %u:%u:%u, size %.1lf MB", name, p_cyl, p_sect, p_head, sizef );
+				cf.Close();
+			}
 		}
 
Index: trunk/Serial_Server/win32/Win32.cpp
===================================================================
--- trunk/Serial_Server/win32/Win32.cpp	(revision 224)
+++ trunk/Serial_Server/win32/Win32.cpp	(revision 225)
@@ -26,5 +26,5 @@
 		"",
 		"  -g [cyl:head:sect]  Geometry in cylinders, sectors per cylinder, and heads",
-		"                      -g without parameters uses CHS mode (default is LBA28)",
+		"                      -g also implies CHS addressing mode (default is LBA28)",
 		"",
 		"  -n [megabytes]      Create new disk with given size or use -g geometry",
@@ -161,4 +161,10 @@
 		else if( imagecount < 2 )
 		{
+			if( createFile && cyl == 0 )
+			{
+				cyl = 65;
+				sect = 63;
+				head = 16;
+			}
 			images[imagecount] = new FlatImage( argv[t], readOnly, imagecount, createFile, cyl, head, sect, useCHS );
 			imagecount++;
Index: trunk/Serial_Server/win32/Win32File.h
===================================================================
--- trunk/Serial_Server/win32/Win32File.h	(revision 224)
+++ trunk/Serial_Server/win32/Win32File.h	(revision 225)
@@ -18,10 +18,22 @@
 {
 public:
-	void Create( char *p_name )
+	int Create( char *p_name )
 	{
 		fp = CreateFileA( p_name, GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0 );
-		if( !fp )
-			log( -1, "'%s', could not create file", p_name );
+
+		if( fp == INVALID_HANDLE_VALUE )
+		{
+			if( GetLastError() == ERROR_FILE_EXISTS )
+			{
+				log( 0, "'%s', file already exists", p_name );
+				return( 0 );
+			}
+			else
+				log( -1, "'%s', could not create file", p_name );
+		}
+
 		name = p_name;
+
+		return( 1 );
 	}
 
@@ -29,6 +41,8 @@
 	{
 		fp = CreateFileA( p_name, GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
-		if( !fp )
+
+		if( fp == INVALID_HANDLE_VALUE )
 			log( -1, "'%s', could not open file", p_name );
+
 		name = p_name;
 	}
@@ -78,5 +92,5 @@
 
 		if( !ReadFile( fp, buff, len, &out_len, NULL ) || len != out_len )
-			log( -1, "'%s', ReadFile failed" );
+			log( -1, "'%s', ReadFile failed", name );
 	}
 
@@ -86,5 +100,5 @@
 
 		if( !WriteFile( fp, buff, len, &out_len, NULL ) || len != out_len )
-			log( -1, "'%s', WriteFile failed" );
+			log( -1, "'%s', WriteFile failed", name );
 	}
 
Index: trunk/Serial_Server/win32/Win32Serial.h
===================================================================
--- trunk/Serial_Server/win32/Win32Serial.h	(revision 224)
+++ trunk/Serial_Server/win32/Win32Serial.h	(revision 225)
@@ -40,5 +40,5 @@
 		
 			pipe = CreateNamedPipeA( PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE|PIPE_REJECT_REMOTE_CLIENTS, 2, 1024, 1024, 0, NULL );
-			if( !pipe )
+			if( pipe == INVALID_HANDLE_VALUE )
 				log( -1, "Could not CreateNamedPipe " PIPENAME );
 		
@@ -62,5 +62,5 @@
 			
 				pipe = CreateFileA( name, GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
-				if( !pipe )
+				if( pipe == INVALID_HANDLE_VALUE )
 					log( -1, "Could not Open \"%s\"", name );
 			
