Writing in User profile [message #465470] |
Wed, 14 July 2010 05:19 |
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 #465690 is a reply to message #465617] |
Thu, 15 July 2010 04:37 |
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 !
|
|
|
|