Home » Other » Client Tools » open file in read only mode(not urgent)
open file in read only mode(not urgent) [message #249609] Thu, 05 July 2007 03:18 Go to next message
v.ram81
Messages: 50
Registered: April 2006
Location: pune
Member

hi,
i am calling a sql report from oracle forms 6i.
spool file created by that report
is stored in c:\ as .txt file.
i want to open that file after run is over.
i am calling that report through host built-in.
i can open that .txt file through host also, using wordpad.
but user can modify the content of that file .
because it is archived.
i want to open that file in read only mode so
the user can only view that file but cannot modify it.
can this is possible using host ?
or any other method?

thanks in advance.

regards,
Ram.
Re: open file in read only mode(not urgent) [message #249626 is a reply to message #249609] Thu, 05 July 2007 05:58 Go to previous messageGo to next message
ThomasG
Messages: 3211
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
you could set the file to read-only with

attrib +R c:\file.txt


as a host-command.

Allthough various text-editors don't care about the read-only flag,
Notepad and Wordpad do

Re: open file in read only mode(not urgent) [message #249850 is a reply to message #249626] Fri, 06 July 2007 03:27 Go to previous messageGo to next message
v.ram81
Messages: 50
Registered: April 2006
Location: pune
Member

thank you for quick reply.
but it is not working..
i am using host command as
host('C:\Program Files\Accessories\WORDPAD.EXE c:\fa768.txt');

but
host('C:\Program Files\Accessories\WORDPAD.EXE c:\fa768.txt +r');

is not working.

and
host('C:\Program Files\Accessories\WORDPAD.EXE c:\fa768.txt attrib +R');
is also not working.

please tell me if i am doing it wrong.

thanks in advance

Ram.
Re: open file in read only mode(not urgent) [message #249854 is a reply to message #249850] Fri, 06 July 2007 03:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
host('attrib +R c:\fa768.txt');

It seems clear to me from the previous post that you have to execute this to turn your file read only.

Regards
Michel

Re: open file in read only mode(not urgent) [message #250154 is a reply to message #249609] Sun, 08 July 2007 13:34 Go to previous message
FrankBerlin
Messages: 5
Registered: July 2007
Location: Berlin, Germany
Junior Member
Hi,

couldn't you create a batch-file with the needed commands and then use

host 'openfile.cmd c:\xxx.txt'
Previous Topic: Toad interface sluggish on editing saved SQL files. Help?
Next Topic: FORMATTING BULK OF FILES AT A TIME
Goto Forum:
  


Current Time: Fri Mar 29 03:35:23 CDT 2024