Exemple #1
0
        private DirectoryEntry AddFileToDirectory(File file, Directory dir, string name, NewFileOptions options)
        {
            DirectoryEntry entry;

            bool createShortNames;
            if (options != null && options.CreateShortNames.HasValue)
            {
                createShortNames = options.CreateShortNames.Value;
            }
            else
            {
                createShortNames = CreateShortNames;
            }

            if (createShortNames)
            {
                if (Utilities.Is8Dot3(name.ToUpperInvariant()))
                {
                    entry = dir.AddEntry(file, name, FileNameNamespace.Win32AndDos);
                }
                else
                {
                    entry = dir.AddEntry(file, name, FileNameNamespace.Win32);
                    dir.AddEntry(file, dir.CreateShortName(name), FileNameNamespace.Dos);
                }
            }
            else
            {
                entry = dir.AddEntry(file, name, FileNameNamespace.Posix);
            }

            return entry;
        }
        private DirectoryEntry AddFileToDirectory(File file, Directory dir, string name)
        {
            DirectoryEntry entry;

            if (CreateShortNames)
            {
                if (Utilities.Is8Dot3(name.ToUpperInvariant()))
                {
                    entry = dir.AddEntry(file, name, FileNameNamespace.Win32AndDos);
                }
                else
                {
                    entry = dir.AddEntry(file, name, FileNameNamespace.Win32);
                    dir.AddEntry(file, dir.CreateShortName(name), FileNameNamespace.Dos);
                }
            }
            else
            {
                entry = dir.AddEntry(file, name, FileNameNamespace.Posix);
            }

            return entry;
        }