Home » Developer & Programmer » Forms » Writing in User profile (Oracle forms 6i,Windows)
Writing in User profile [message #465470] Wed, 14 July 2010 05:19 Go to next message
jolly_makkar
Messages: 63
Registered: March 2008
Member
Hi ,The Scenario is that we have to restrict clients to write file on C drive for which we have to grant admin privilleges(OS) which we dont wanna give.
Rather they can write on their own profile.
In CMD we can find their profile with %userprofile% command,but i am confused of using it in oracle form.

so is there any possibilities to redirect O/P to userprofile\your_file.txt

Just for an instance ,code is like this which is currently writing in C: drive

Declare
in_file TEXT_IO.FILE_TYPE;
linebuf VARCHAR2(80);
your_file VARCHAR2(50) := 'C:\TEMP\your_file.dat';
text_line VARCHAR2(400);
BEGIN
in_file := TEXT_IO.FOPEN(your_file, 'W');

TEXT_IO.PUT_LINE(in_file, 'Testing');

TEXT_IO.FCLOSE(in_file);
EXCEPTION
WHEN NO_DATA_FOUND THEN
TEXT_IO.FCLOSE(in_file);
END; 



Thanks




CM: changed [quote] tags to [code] tags.

[Updated on: Wed, 14 July 2010 05:47] by Moderator

Report message to a moderator

Re: Writing in User profile [message #465617 is a reply to message #465470] Thu, 15 July 2010 00:43 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you tried using '%userprofile%' in the file name?

If that doesn't work then you can use the 'Get_Temp_Directory' feature of 'webutil', issue a 'host' command to 'echo' the '%userprofile%' to a file in that area, and then use 'text_io' to read it.

David
Re: Writing in User profile [message #465690 is a reply to message #465617] Thu, 15 July 2010 04:37 Go to previous messageGo to next message
jolly_makkar
Messages: 63
Registered: March 2008
Member
Thanks Sir,Your guidance worked .Its solved now.I have used this package and function

Quote:
]Win_Api_environment.Get_temp_directory(true);


In 6i forms, i also used d2kwutil library to inherit above package.

Thanks a lot !
Re: Writing in User profile [message #465697 is a reply to message #465690] Thu, 15 July 2010 05:58 Go to previous message
crafet
Messages: 11
Registered: July 2010
Location: China
Junior Member
bingo
Previous Topic: Select photo (BLOB) data into Developer6i Image Item
Next Topic: How to Open html in Form?
Goto Forum:
  


Current Time: Fri Sep 20 07:01:18 CDT 2024