如何将任意文件夹,制成ISO文件.(需要源码)(可再加分)(200分)

  • 主题发起人 主题发起人 jiaa
  • 开始时间 开始时间
J

jiaa

Unregistered / Unconfirmed
GUEST, unregistred user!
问题如上。要求制作成标准的ISO文件。可以被流行的虚拟光驱软件读出。
 
呵呵,你是不是想知道ISO文件的格式,然后将文件写进去?
太麻烦了吧
不如直接调用外部能直接生成ISO文件的工具,如Cdimage即可
简单多了[:D][:D]
 
//iso类的头文件
unit mystruct;
interface
const
sectorsize = 2048; //定义扇区的大小
bothword0 = $00000000; //bigword表示分bothendian,littleword在前,bigword在后
bothword1 = $01000001;
bothword2048 = $00080800;
markbuf: array[0..7] of byte = ($01, $43, $44, $30, $30, $31, $01, $00);
sysmarkbuf: array[0..4] of byte = ($57, $69, $6E, $33, $32);
volsetbuf: array[0..33] of Byte = ($22, $00, $14, $00, $00, $00, $00, $00, $00, $14, $00, $08, $00, $00, $00, $00
, $08, $00, $46, $01, $01, $08, $00, $00, $00, $02, $00, $00, $01, $00, $00, $01, $01, $00); //只有一个目录的情况下可行
applicationinfo = 'Application made in our think - gohoo';
// CD001_mark=$00013130304443FF;//= CD001
CD001_mark: array[0..7] of Byte = ($FF, $43, $44, $30, $30, $31, $01, $00);

type
//--- Graphic Tjpegimage
pisotop = ^Tisotop;
Tisotop = packed record
marked: array[0..7] of byte; //5byte= $0143443030310100(CDOO1)
systemidentifier: array[0..31] of char; //32byteWin32余下用20$57696E3332$20202020..
volumeidentifier: array[0..31] of char; // 32byte卷标余下用20填充
marks2: int64; //8=0;
totalsectors: array[0..1] of longword; //8byte as a both endian double word扇区总数量
marks1: array[0..15] of word; //32byte= zero
volumeSetSize: longword; //4byte=1 but as a both endian word(01 00 00 01)
volumeSequenceNumber: longword; //4byte=1 as volumeSetsize;
sectorSize: longword; //4byte=2048 asboth endian word(00 08 08 00)
pathTableLength: array[0..1] of integer; //8byte=pathtable number both endian double word
numberFirstSectorinFirst: Integer; //4byte= as a little endian double word
numberFirstSectorinSecond: Integer; //4byte= as a little endian double word
numberFirstSectorinFirstbig: integer; //4byte= as a big endian double word
numberFirstSectorinSecondbig: Integer; //4byte= as a big endian double word
rootDirectoryRecord: array[0..33] of byte; //34byte= roob path
volumeSetIdentifier: array[0..127] of byte; //128=0or20and'you want write' volume set identifier
publisherIdentifier: array[0..127] of byte; //128=0or20or'you want write'publisher identifier
dataPreparerIdentifier: array[0..127] of byte; //128=0or'you want write'data preparer identifier
applicationIdentifier: array[0..127] of char; //128
copyrightFileIdentifier: array[0..36] of byte; //37=0or you want write版权
abstractFileIdentifier: array[0..36] of byte; //37=0 or you want write 摘要
bibliographicalFileIdentifier: array[0..36] of byte; //37=0 or you want write 目录
datetimeVolumeCreation: array[0..16] of char; //17=datetime+$20 共17byte
datetimeRecentmodification: array[0..16] of char; //17=datetime+$20 共17byte
datetimeVolumeExpires: array[0..16] of char; //17=datetime+$20 共17byte;
datetimeVolumeEffective: array[0..16] of char; //17=datetime+$20 共17byte
mark0: byte; //1=1;
mark1: byte; //1=0;
reservedApplication: array[0..511] of byte; //512=0 or you want write;
endmark: array[0..652] of byte; //653=0;
end;
Ppathtop = ^Tpathtop;
Tpathtop = packed record
namelength: byte; //1=pathlength if root then =1
extractattr: byte; //1=0;
numbefirstsector: longword; //4=first sector in path ,double word;
numberparent: word; //2=number of record for parent directory the first record is number 1,
//the second record is number 2, etc.
end;
Pdirectorytop = ^Tdirectorytop;
Tdirectorytop = packed record
numberbytes: byte; //1=number of bytes in the record
extractattr: byte; //1=0;
firstsector: array[0..1] of integer; //8=number of the first sector of file data or directory,both endian double word,when empty file =0;
bytefile: array[0..1] of integer; //8=number of bytes of file data or length of directory
iyear: byte; //1=number of years since 1900
imonth: byte; //1=month, where 1=January, 2=February, etc.
iday: byte; //1=day of month, in the range from 1 to 31
ihour: byte; //1=hour, in the range from 0 to 23
iminute: byte; //1=in the range from 0 to 59
isecond: byte; //1=in the range from 0 to 59
ioffset: byte; //1=from Greenwich Mean Time
flags: byte; //1=0 or 2 for normal file
interleaved: byte; //1=0;
interleavegap: byte; //1=0;
volumesequence: array[0..1] of word; //4=1 both endia word;
dlength: byte; //1=dir length or filename length;
end;
pfilerecord=^filerecord;
filerecord = packed record
fname: string[255]; //文件名
fstart: Integer; //起始扇区
fsize: Integer; //文件大小
fscor: Integer; //占用扇区数
end;
pdirecord=^direrecord;
direrecord = packed record
dirindex: Integer; //路径编号
dirsize: Integer; //路径表尺寸
dirscord: Integer; //占用扇区数
dirstart: integer; //起始扇区
pdir: Integer; //父路径序号
pdirstart: Integer; //夫路径起始扇区
dirname: string[255]; //路径名成
end;
pallrecord=^allrecord;
allrecord = packed record
fname: string[255]; //文件名
fstart: Integer; //起始扇区
fsize: Integer; //文件大小
//分解
isfile:Boolean;//判断是路径还是文件
//分解
dirsize: Integer; //路径表尺寸
dirstart: integer; //起始扇区
dirname: string[255]; //路径名成
end;
Ppathrecord=^pathrecord;
pathrecord=packed record
pathindex:integer;//路径纪录的序号
namesize:integer; //路径名称长度
sectorbegin:Integer;//路径起始扇区
// allsector:Integer;//路径占用扇区数 这样控制读取纪录直到下一个文件或夹名称长度为0
parentrecordindex:integer;//父目录序号
pathname:string[255];//名字
end;
implementation
end.
//测试通过了的 lz看看
 
对呀?zhenxin0603,知道就给一个了。
 
baiduan,谢谢,我先试试了。
 
我这有,怎么发给你,我QQ:324591133
 
邮箱 :df_jiaa@126.com
qq : 627832329
 
可以用,我也试过了。很厉害哦
 
CDIMAGE 2.39 CD-ROM Premastering Utility
Copyright (C) Microsoft, 1993-1997. All rights reserved.
For Microsoft internal use only.

Usage: CDIMAGE [options] sourceroot targetfile

-l volume label, no spaces (e.g. -lMYLABEL)
-t time stamp for all files and directories, no spaces, any delimiter
(e.g. -t12/31/91,15:01:00)
-g encode GMT time for files rather than local time
-h include hidden files and directories
-n allow long filenames (longer than DOS 8.3 names)
-nt allow long filenames, restricted to NT 3.51 compatibility
(-nt and -d cannot be used together)
-d don't force lowercase filenames to uppercase
-c use ANSI filenames versus OEM filenames from source
-j1 encode Joliet Unicode filenames AND generate DOS-compatible 8.3
filenames in the ISO-9660 name space (can be read by either
Joliet systems or conventional ISO-9660 systems, but some of the
filenames in the ISO-9660 name space might be changed to comply
with DOS 8.3 and/or ISO-9660 naming restrictions)
-j2 encode Joliet Unicode filenames without standard ISO-9660 names
(requires a Joliet operating system to read files from the CD)
When using the -j1 or -j2 options, the -n, -nt, and -d options
do not apply and cannot be used.
-js non-Joliet "readme.txt" file for images encoded with -j2 option
(e.g. -jsc:/location/readme.txt). This file will be visible as
the only file in the root directory of the disc on systems that
do not support the Joliet format (Windows 3.1, NT 3.x, etc).
-u1 encode "UDF" file system along with mirror ISO-9660 file system
(-n, -nt, -d, -c, or -j1, -j2 options apply to ISO-9660 portion)
-u2 encode "UDF" file system without a mirror ISO-9660 file system
(requires a UDF capable operating system to read the files)
-us non-UDF "readme.txt" file for images encoded with -u2 option
(e.g. -usc:/location/readme.txt). This file will be visible as
the only file in the root directory of the disc on systems that
do not support the UDF format.
-b "El Torito" boot sector file, no spaces
(e.g. -bc:/location/cdboot.bin)
-s sign image file with digital signature (no spaces, provide RPC
server and endpoint name like -sServerName:EndPointName)
-x compute and encode "AutoCRC" values in image
-o optimize storage by encoding duplicate files only once
-oc slower duplicate file detection using binary comparisons rather
than MD5 hash values
-oi ignore diamond compression timestamps when comparing files
-os show duplicate files while creating image
(-o options can be combined like -ocis)
-w warning level followed by number (e.g. -w4)
1 report non-ISO or non-Joliet compliant filenames or depth
2 report non-DOS compliant filenames
3 report zero-length files
4 report each file name copied to image
-y test option followed by number (e.g. -y1), used to generate
non-standard variations of ISO-9660 for testing purposes:
1 encode trailing version number ';1' on filenames (7.5.1)
2 round directory sizes to multiples of 2K (6.8.1.3)
5 write /i386 directory files first, in reverse sort order
6 allow directory records to be exactly aligned at ends of sectors
(ISO-9660 6.8.1.1 conformant but breaks MSCDEX)
7 warn about generated shortnames for 16-bit apps under NT 4.0
b blocksize 512 bytes rather than 2048 bytes
d suppress warning for non-identical files with same initial 64K
-k (keep) create image even if fail to open some of the source files
-m ignore maximum image size of 681,984,000 bytes
-a allocation summary shows file and directory sizes
-q scan source files only, don't create an image file

NOTE: Many of these options allow you to create CD images
that are NOT compliant with ISO-9660 and may also
NOT be compatibile with one or more operating systems.
If you want strict ISO and DOS compliance, use the -w2
warning level and correct any discrepencies reported.
YOU are responsible for insuring that any generated CDs
are compatible with all appropriate operating systems.
Also note that Microsoft company information is placed
in the image volume header, so don't use this program
to generate CDs for companies other than Microsoft.
信箱已发,查收
 
zhenxin0603 ,我的邮箱现在还没收到,能不能用QQ传。
QQ : 627832329
 
接受答案了.
 
后退
顶部