VirtualBox

Opened 16 years ago

Closed 14 years ago

Last modified 13 years ago

#1870 closed defect (duplicate)

Cannot use `mkdir a\b` in shared folder

Reported by: Peter Arrenbrecht Owned by:
Component: shared folders Version: VirtualBox 2.0.4
Keywords: Cc:
Guest type: Windows Host type: Linux

Description

Mount a shared folder. Then try mkdir a\b. Fails with "The system cannot find the file specified.". Doing the sequence mkdir a and then mkdir a\b works. This bug is breaking my Ant builds because javac cannot create its output folders.

Change History (30)

comment:1 by bikehead, 16 years ago

Same here. I'm using Windows XPpro with ant and my builds all fail because any creation of a directory or file where the creation of a parent is implied fails.

I can successfully do the build when the directory is mounted via samba or if I copy the directory to the guest OS disk. It only happens with a shared folder.

I run fedora core 9, x86_64.

in reply to:  1 comment:2 by bikehead, 16 years ago

Replying to bikehead:

Same here. I'm using Windows XPpro with ant and my builds all fail because any creation of a directory or file where the creation of a parent is implied fails.

I can successfully do the build when the directory is mounted via samba or if I copy the directory to the guest OS disk. It only happens with a shared folder.

I run fedora core 9, x86_64.

I tried working around this using samba on the host computer and mapping the drive in Windows. This works in that the mkdir-s work properly, but it is over *three* times slower than using the shared folders. For me this is a pretty big hit since my 1 hour system (yes the system is quite large) build goes to over 3.5 hours.

It would be great if we could get some status on if and when this might get addressed.

comment:3 by Frank Mehnert, 16 years ago

Problem confirmed. We are currently not sure which part is misbehaving, either our guest additions or the host shared folders service.

comment:4 by Frank Mehnert, 16 years ago

Summary: Cannot use `mkdir a\b` in shared folder (Windows XP guest, Ubuntu host)Cannot use `mkdir a\b` in shared folder => Fixed in 1.6.6

Bug fixed in 1.6.6 (not yet released), you need to update the guest additions.

comment:5 by Frank Mehnert, 16 years ago

Resolution: fixed
Status: newclosed

comment:6 by Chris Slater, 16 years ago

Resolution: fixed
Status: closedreopened

It doesn't appear as if this fix made it in 1.6.6, or it was not complete. I am running a Fedora 9 (AMD64) host with a Windows XP guest. I just updated VirtualBox and installed the 1.6.6 additions. I am still getting the same error when using ant to do a build. The build works fine when using a samba share.

"BUILD FAILED T:\workspace\hre_29\build.xml:301: Failed to copy T:\workspace\hre_29\rulesconfig\drools\CallCenter\CallCenter.drl to T:\workspace\hre_29\target\classes\drools\CallCenter\CallCenter.drl due to java.io.FileNotFoundException T:\workspace\hre_29\target\classes\drools\CallCenter\CallCenter.drl (The system cannot find the file specified)"

comment:7 by Frank Mehnert, 16 years ago

Please could you check if

mkdir foo\bar\buzz

works if foo and/or bar is not present? Use the command line. Because that works fine here and I wonder what is different with your environment.

in reply to:  7 comment:8 by Chris Slater, 16 years ago

mkdir foo\bar\buzz does appear to work on my system as well. I also tried xcopy, which works. It looks like it might be an Ant/Shared Folders problem when Ant does a copy. As I mentioned earlier, the Ant build script I am using works fine (just very slow) using samba to connect to the same shared folder. Also FYI, I upgraded to VB 2.0.0.

comment:9 by Frank Mehnert, 16 years ago

Without a simple test case this problem is difficult to fix.

comment:10 by Chris Slater, 16 years ago

When I get some free time, I will see if I can create one.

comment:11 by Peter Arrenbrecht, 16 years ago

Paste the following into a file build.xml on a shared folder:

<?xml version="1.0" encoding="UTF-8"?>
<project name="vboxbug1870" default="test" basedir=".">
	<description>Exposes VirtualBox bug #1870.</description>
	<target name="test">
		<delete dir="a" />
		<mkdir dir="a/b/c" />
	</target>
</project>

Install Java and Ant. Then open a command prompt in the folder containing build.xml. Run the command ant.

My output for VirtualBox 1.6.6 is:

F:\vbox-bug>ant
Buildfile: build.xml

test:

BUILD FAILED
F:\vbox-bug\build.xml:6: Directory F:\vbox-bug\a\c creation was not successful for an unknown reason

Total time: 0 seconds

in reply to:  11 ; comment:12 by Chris Slater, 16 years ago

It looks like the underlying problem is with java file io. Here is a test program that removes an existing test directory structure if it exists, then creates it again with a single File.mkdir instruction. To run, copy the text below to a file called FileIOTest.java, compile the code with javac, then run "java java FileIOTest" inside of a shared folder.

import java.io.File;


public class FileIOTest 
{
	
	static public boolean deleteDirectory(File path) 
	{
		if( path.exists() ) 
		{
			File[] files = path.listFiles();
		    for(int i=0; i<files.length; i++) 
		    {
		    	if(files[i].isDirectory()) 
		    		deleteDirectory(files[i]);
		        else 
		           files[i].delete();
		    }
		}
		return(path.delete());  
	}

	
	public static void main(String args[])
	{
		String mkdirPath = "vbtrac1870"+File.separator+"foo"+File.separator+"bar";
		File dir = new File(mkdirPath);
		String topDirName = "vbtrac1870";
		File topDir = new File(topDirName);
		
		if(topDir.exists())
		{
			System.out.println("Removing old test directory structure: "+topDirName);
			try
			{
				if (deleteDirectory(topDir))
					System.out.println("-- SUCCESS");
				else
					System.out.println("-- FAILURE - structure not removed, no exceptions thrown");
			}
			catch(Exception e)
			{
				System.out.println("-- ERROR");
				e.printStackTrace();
			}
		}
		
		System.out.println("Creating directory structure: "+mkdirPath);
		try
		{
			if (dir.mkdirs())
				System.out.println("-- SUCCESS");
			else
				System.out.println("-- FAILURE - structure not created, no exceptions thrown");
		}
		catch(Exception e)
		{
			System.out.println("-- ERROR");
			e.printStackTrace();
		}
	}
	

}

Here are my results:

Using samba:

Z:\>java FileIOTest
Creating directory structure: vbtrac1870\foo\bar
-- SUCCESS

Using a shared folder:

T:\>java FileIOTest
Removing old test directory structure: vbtrac1870
-- SUCCESS
Creating directory structure: vbtrac1870\foo\bar
-- FAILURE - structure not created, no exceptions thrown

in reply to:  12 comment:13 by Chris Slater, 16 years ago

Oops, the command to run should be "java FileIOTest" not "java java FileIOTest"

comment:14 by bikehead, 16 years ago

Just echoing a "me too" about the problem still happening for me in VirtualBox 2.0 which I'm assuming encompasses "1.6.6". I also use ant so I'll be interested in the results of electricsam's test case.

(I mainly added this comment because there doesn't seem to be a way to add myself to the cc list and I am very much interested in the status of this bug. I use Vbox for compiling Java code under windows and the speed difference between Samba and shared folders is very important to me.)

comment:15 by Sander van Leeuwen, 16 years ago

Please update to 2.0.2 and install the 2.0.2 additions there. The additions installer had some issues before that prevented it from updating some files.

in reply to:  15 comment:16 by Chris Slater, 16 years ago

Unfortunately upgrading to 2.0.2 and installing the 2.0.2 additions does not fix the problem. I'm getting the same result from the java test.

T:\>java FileIOTest
Creating directory structure: vbtrac1870\foo\bar
-- FAILURE - structure not created, no exceptions thrown

comment:17 by bikehead, 15 years ago

Is there any new status on this bug? I've upgraded to 2.0.4 and reinstalled the shared folder extensions. I'm developing java applications under a windows guest and I'd love to have this bug fixed: shared folders seem to be about 3-5x faster than a samba mount.

comment:18 by Chris Slater, 15 years ago

I just tried with 2.0.4. It is still not fixed.

comment:19 by Frank Mehnert, 15 years ago

Version: VirtualBox 1.6.2VirtualBox 2.0.4

comment:20 by Chris Slater, 15 years ago

Just a heads up for anyone else with this problem, I tried with version 2.0.6. It still does not work.

comment:21 by bikehead, 15 years ago

Still doesn't work in 2.1.4. Is there any status on when/if this will be fixed?

comment:22 by vnguyen, 15 years ago

Thanks for reporting this issue. Does anyone have a workaround?

comment:23 by MrX1980, 15 years ago

Please try it with v3.0.0

comment:24 by igorgatis, 15 years ago

This is still an issue as of v3.0.2 r49928

comment:25 by igorgatis, 15 years ago

This is really bad: it is preventing me from building with ant as well. Where can I vote for this bug?

comment:26 by bikehead, 15 years ago

My current status with this bug is that the test program mentioned above does work under 3.0.2. However my ant build still fail.

I isolated the failure and I opened a new bug for this as http://www.virtualbox.org/ticket/4299 since the mkdir doesn't really fail any more, but it was immediately marked as a duplicate of this one; sigh. However, that ticket has some files for an ant build that does fail under 3.0.2.

My hope is that the VBox testers will use that test case to verify that this bug is fixed: it was reported one year ago!

comment:27 by Chas Emerick, 15 years ago

Still doesn't work in v3.0.4...getting this error in ant builds in shared folders:

Directory G:\osint\build\cluster creation was not successful for an unknown reason

comment:28 by Chas Emerick, 15 years ago

Maybe someone with appropriate privs can drop the "=> Fixed in 1.6.6" from the title of this issue (just in case that's throwing off the prioritization of the problem)? There's a lot of Java apps out there that will fail in highly unexpected ways because of this.

comment:29 by Andy Key, 15 years ago

Ditto. Confirmed to still not work in 3.0.6, Ubuntu 9.0.4 (32-bit i686) host, Windows XP guest, Guest Additions 3.0.6 installed.

Any chance on getting this issue actually fixed?

comment:30 by Frank Mehnert, 14 years ago

Resolution: duplicate
Status: reopenedclosed
Summary: Cannot use `mkdir a\b` in shared folder => Fixed in 1.6.6Cannot use `mkdir a\b` in shared folder

Closing this as duplicate of #4299 because there are more recent comments. Bug is under work.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use