Пример #1
0
//============================================================================
//		NFileUtilities::UnmountVolume : Unmount a volume.
//----------------------------------------------------------------------------
NStatus NFileUtilities::UnmountVolume(const NFile &theFile)
{


	// Validate our parameters
	NN_ASSERT(theFile.IsDirectory());



	// Unmount the volume
	return(NTargetFile::UnmountVolume(theFile.GetPath()));
}
Пример #2
0
static void DumpBinary(void)
{	NDataEncoder	theEncoder;
	NFile			theFile;
	NString			theText;
	NData			theData;



	// Create the binary .plist
	theFile = NFileUtilities::GetTemporaryFile("binary.plist");
	NFileUtilities::SetFileText(theFile, kPropertyListXML);

	NTask::Execute("/usr/bin/plutil", "-convert", "binary1", theFile.GetPath().GetUTF8());



	// Dump it
	theData = NFileUtilities::GetFileData(theFile);
	theText = theEncoder.Encode(theData, kNDataEncodingHex);
	theFile.Delete();

	NN_LOG("\nstatic const NString kPropertyListBinary					=	\"%@\";\n", theText);
}