Board index » delphi » Help Read Only Problem.. Emergency

Help Read Only Problem.. Emergency

Thanks for your help.  I need to deliver a CD-ROM tomorrow and havee run
into the following problems.  I am using Delphi V1.0  in WINdows 3.1

I am trying to open a file on a CD-ROM which has a File Atrib of READ
ONLY.
I need to copy this file from the CD to a hard Drive.  Everytime I use
RESET to opne the file I get a file access error. How do I set a file to
READ ONLY so I can open it and use block reads & writes to copy the file?

Is there a better way to do this.  Any help would be greatly appreciated.
Please E-Mail me at JonRu...@aol.com

Many thanks in advance.

 

Re:Help Read Only Problem.. Emergency


you need to set FileMode to 0 - all is explained in the online help

HTH,

--
Paul Motyer
***pa...@linuxserver.pccity.com.au*** currently broken
Croydon, Australia, 3136

JonRubin <jonru...@aol.com> wrote in article
<19970204174600.MAA15...@ladder01.news.aol.com>...

Quote
> Thanks for your help.  I need to deliver a CD-ROM tomorrow and havee run
> into the following problems.  I am using Delphi V1.0  in WINdows 3.1

> I am trying to open a file on a CD-ROM which has a File Atrib of READ
> ONLY.
> I need to copy this file from the CD to a hard Drive.  Everytime I use
> RESET to opne the file I get a file access error. How do I set a file to
> READ ONLY so I can open it and use block reads & writes to copy the file?

> Is there a better way to do this.  Any help would be greatly appreciated.
> Please E-Mail me at JonRu...@aol.com

> Many thanks in advance.

Re:Help Read Only Problem.. Emergency


There is a global variable which contains the MODE in which
the file will be opened.
The variable is located in the System unit
it is called FileMode
and can be set to
0 read only
1 write only
2 read/write

It might also be wise not to use a File with
AssignFile/Reset/CloseFile. Try using a
TFileStream instead...

Other Threads