Possible error?

Sep 19, 2012 at 8:52 PM

So I'm trying to get some sort of "mass" function for specific images using ZLP. You could specify deletion, removal or copy, along with a filter (some tags), and it would do the action on all the images in the execution folder that pass the filter.

More specific: It's for mass copying of pictures off of *booru sites.

But on-topic for now. When I try to delete:

ZlpIOHelper.DeleteFile(mf.fileName);

With the file being:

F:\<40 char path to folder>\<205 char filename>.jpg

The filename is 209 chars extension included, and the full path is 253 chars. Somehow, this is long enough to error a regular "System-filecopy", but not enough to get a "Zeta-filecopy", as I get:

Error 3 copying file '<filename>': <"The system can't find the given path." in dutch>

I've reproduced the error for filenames of size 206-224 with full paths of 252-270.

Now as a workaround, I made a virtual drive "subst Y: F:\<40 char path to folder>" so it doesn't error anymore, I think. At least it hasn't yet.

Am I doing something wrong that this isn't working, or?

Coordinator
Sep 20, 2012 at 3:44 PM

Thanks, Oscar, I'll take a look and fix this.

Which OS are you onto with this issue? XP? Vista? 7? 8?

Coordinator
Sep 20, 2012 at 5:04 PM

Just written a unit test:

[Test]
public void TestCodePlex()
{
	// http://zetalongpaths.codeplex.com/discussions/396147

	const string directoryPath =
		@"c:\1234567890123456789012345678901234567890";
	const string filePath =
		@"c:\1234567890123456789012345678901234567890\1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345.jpg";

	Assert.DoesNotThrow(() => ZlpIOHelper.CreateDirectory(directoryPath));
	Assert.DoesNotThrow(() => ZlpIOHelper.WriteAllText(filePath, @"test"));
	Assert.DoesNotThrow(() => ZlpIOHelper.DeleteFile(filePath));
	Assert.DoesNotThrow(() => ZlpIOHelper.DeleteDirectory(directoryPath, true));
}

This runs successfully on my Win7, 64-bit machine. Since I'm not sure whether I have a newer version I'll update ASAP the download here on CodePlex.