Giter VIP home page Giter VIP logo

exfat's People

Contributors

picrap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

exfat's Issues

Thread-satefy

Currently it's randomly supported (nothing to be proud of).

delay write of all metadata

will be good to have option to delay writing of all of metadata (Directory and FAT entries).
So it will be possible to sequential write data of many files without interrupting to write its metadata.
Sequential write is huge faster than write non-sequentially relatively small chunks.
Flush metadata either explicitly on convenient time or optionally by configurable timer.
Timer can be different for different operations, like 30 seconds for adding/moving/renaming/changing files and 1 second for deleting/shrinking files.
Either to have 2 streams, one for file data and second for metadata, so stream for metadata can be buffered.

Error when running the program - Error Failed to find TextTransform.exe tool

I just cloned the project and Im trying to run it in Visual Studio. However I get errors:

Warning A custom tool 'TextTemplatingFileGenerator' is associated with file 'ExFat.tt', but the output of the custom tool was not found in the project. You may try re-running the custom tool by right-clicking on the file in the Solution Explorer and choosing Run Custom Tool. ExFat.Core

Error Failed to find TextTransform.exe tool at 'C:\Program Files (x86)\Common Files\Microsoft Shared\TextTemplating\14.0\TextTransform.exe. ExFat.Core

Warning A custom tool 'TextTemplatingFileGenerator' is associated with file 'Properties\ProductInfo.tt', but the output of the custom tool was not found in the project. You may try re-running the custom tool by right-clicking on the file in the Solution Explorer and choosing Run Custom Tool. ExFat.Core

Warning A custom tool 'TextTemplatingFileGenerator' is associated with file 'ExFat.DiscUtils.tt', but the output of the custom tool was not found in the project. You may try re-running the custom tool by right-clicking on the file in the Solution Explorer and choosing Run Custom Tool. ExFat.DiscUtils

disk corruption issues

Hello,

A couple of problems I encountered while using ExFat.DiscUtils with a vmdk virtual disk formatted ExFat:

  1. The below code was used to copy files placed in a host directory to an empty directory in a VM.
    Then, we power on the VM ,delete the files from the VM manually via file explorer, then power off the VM.
    Doing this a couple of times (copying files to VM then deleting them and re-copying) with lots of files or directories causes disk corruption.
    Specifically, fill the host directory with 300-400 files, execute the given code, then delete the files copied into the VM (manually).
    After repeating this a couple of times the file system becomes corrupted.
    This has been reproduced a couple of times but seems a bit random.

  2. Copying an empty file (can be done with the below code) causes disk corruption.
    It seems this happens every time we copy empty files.

Code used:

private static void Test(string vmdkPath, int partitionNumber, string pathInHost, string pathInVm)
{
	using (VirtualDisk disk = new DiscUtils.Vmdk.Disk(vmdkPath,FileAccess.ReadWrite))
	using (ExFatFileSystem fs = new ExFatFileSystem(disk.partitions[partitionNumber].Open()))
	{
		string[] hostDirFilePaths= Directory.GetFiles(pathInHost, "*.*", SearchOption.TopDirectoryOnly);
		
		foreach (string hostFilePath in hostDirFilePaths)
		{
			string vmFilePath = Path.Combine(pathInVm, Path.GetFileName(hostFilePath));
			
			string dst = Path.Combine(fs.Root.FullName, vmFilePath);
			
			using (Stream dstStream = fs.OpenFile(dst, FileMode.Create, FileAccess.ReadWrite))
			using (Stream sourceStream = File.Open(hostFilePath, FileMode.Open, FileAccess.Read))
			{
				CoptStream(sourceStream, dstStream);
			}
		}
	}
}

private static void CopyStream(Stream srcStream, Stream dstStream)
{
	int bufferLength = (int)Math.Min(srcStream.Length, 4*1024*1024);
	byte[] buffer = new byte[bufferLength];
	int bytesRead= 0;
	
	while((bytesRead = srcStream.Read(buffer,0,bufferLength))>0)
	{
		dstStream.Write(buffer,0,bytesRead);
		if(bytesRead < bufferLength)
		{
			break;
		}
	}
}

Thanks,
Chris

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.