예제 #1
0
        public static bool CopyFiles(MFSFile[] files, ushort dir)
        {
            if (disk == null || disk.Format == MFS.DiskFormat.Invalid)
            {
                return(false);
            }

            foreach (MFSFile file in files)
            {
                MFSRAMUtil.WriteFile(disk, MFSRAMUtil.ReadFile(disk, file), file.Name + (file.Ext != "" ? "." + file.Ext : ""), dir);
            }

            return(true);
        }
예제 #2
0
        public static bool SaveFile(MFSFile file, string filepath)
        {
            if (disk == null || disk.Format == MFS.DiskFormat.Invalid)
            {
                return(false);
            }

            byte[]     filedata = MFSRAMUtil.ReadFile(disk, file);
            FileStream fileout  = new FileStream(filepath, FileMode.Create);

            fileout.Write(filedata, 0, filedata.Length);
            fileout.Close();

            return(true);
        }
예제 #3
0
        public static bool SaveFiles(MFSFile[] files, string folderpath)
        {
            if (disk == null || disk.Format == MFS.DiskFormat.Invalid)
            {
                return(false);
            }

            foreach (MFSFile file in files)
            {
                byte[]     filedata = MFSRAMUtil.ReadFile(disk, file);
                FileStream fileout  = new FileStream(folderpath + "\\" + file.Name + (file.Ext != "" ? "." + file.Ext : ""), FileMode.Create);
                fileout.Write(filedata, 0, filedata.Length);
                fileout.Close();
            }
            return(true);
        }
예제 #4
0
 public static byte[] LoadFileData(MFSFile file)
 {
     return(MFSRAMUtil.ReadFile(disk, file));
 }