libraries/iosrv/client/file_utils.cpp
changeset 50 e81b4e28b3e2
parent 0 7f656887cf89
--- a/libraries/iosrv/client/file_utils.cpp	Thu Aug 26 15:28:08 2010 +0100
+++ b/libraries/iosrv/client/file_utils.cpp	Sat Aug 28 00:12:38 2010 +0100
@@ -511,3 +511,22 @@
 	User::LeaveIfError(FindFile(aFs));
 	}
 
+EXPORT_C void TFileName2::Normalize(RFs& aFs)
+	{
+	// Change this so that the case of each component matches what the file system reckons. ie C:\SYS\Bin would be changed to c:\sys\bin
+	ASSERT(IsAbsolute());
+	TInt err = KErrNone;
+	TEntry entry;
+	TParse parse;
+	parse.Set(*this, NULL, NULL);
+
+	while (!err)
+		{
+		err = aFs.Entry(parse.FullName(), entry);
+		if (!err) err = parse.PopDir();
+		if (!err)
+			{
+			Replace(parse.FullName().Length(), entry.iName.Length(), entry.iName);
+			}
+		}
+	}