host procedure on 6i [message #436816] |
Mon, 28 December 2009 11:53 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
marceloy
Messages: 11 Registered: December 2009 Location: Brazil
|
Junior Member |
|
|
Hi everybody,
I've got a problem when I use the HOST procedure to work with DOS Prompt. When I access the DOS Prompt via Oracle Forms HOST Procedure, the name of files and folders got limited by 8 chars plus extension.
Lets suppose I want to copy a file and the file name is my_image.jpg. What I have to do is:
HOST('copy MY_IMA~1 C:\TEMP\IMAGE01');
I guess it sucks cause the function GET_FILE_NAME give me the filename as my_image.jpg.
Do I have to convert the filename every time?
Does everybody know a better way to this?
[]'s
[Updated on: Mon, 28 December 2009 12:01] Report message to a moderator
|
|
|
Re: host procedure on 6i [message #436819 is a reply to message #436816] |
Mon, 28 December 2009 12:25 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21808 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I don't have Forms to test by myself, but - I guess it won't cost much if you try it.
How about such a workaround: create a DOS batch script (let's call it "cp.bat") with a simple copy command:REM this is my "long file names" copy script
copy %1 %2
Now you'd call it from Forms ashost('cp.bat ' || first_file ||' '|| second_file);
In DOS, it would look like this:C:\>cp a_long_file_name.txt short.txt
C:\>copy a_long_file_name.txt short.txt
1 file(s) copied.
C:\>
What do you think?
[Updated on: Mon, 28 December 2009 12:26] Report message to a moderator
|
|
|
Re: host procedure on 6i [message #436831 is a reply to message #436816] |
Mon, 28 December 2009 13:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
marceloy
Messages: 11 Registered: December 2009 Location: Brazil
|
Junior Member |
|
|
Nope, it didn't work.
The cp.bat file did exactly the same as the DOS copy command. The bat file recognized just the 8char files.
I don't understand, my XP prompt is working fine with long filenames. Why the host procedure on forms is doing wrong?
[]'s again
|
|
|
|
Re: host procedure on 6i [message #436841 is a reply to message #436838] |
Mon, 28 December 2009 17:46 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ThomasG
Messages: 3211 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
I don't have forms either, but I have seen the same thing from other software that calls commands.
Two things that come to mind in that direction :
Is there a way to tell if the HOST command actually uses the cmd.exe shell or the command.com shell?
You could try putting the file names in double quotes. (which will then also handle files that have blanks in their names)
|
|
|
Re: host procedure on 6i [message #436895 is a reply to message #436816] |
Tue, 29 December 2009 07:14 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
marceloy
Messages: 11 Registered: December 2009 Location: Brazil
|
Junior Member |
|
|
I guess that's the point.
Even if a have XP on client and NT as server, the HOST procedure on Forms is loading command.com shell rather than cmd.exe shell. (1)
So, I tried the following syntax:
-- Open cmd, execute copy and then return to command.com shell
str := 'copy "long filename.jpg" "short.jpg" & exit | cmd'
host(str);
That code works fine when I execute on windows command.com prompt (Win+R), but when I run on Forms I got the message: "Too many parameters"
Any other idea?
PS. Double quotes didn't work.
(1) The documentation says that only Win95 loads command.com and NT would load cmd.exe (p. 253). I don't know why it's loading command.com.
|
|
|
Re: host procedure on 6i [message #437010 is a reply to message #436816] |
Wed, 30 December 2009 05:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
marceloy
Messages: 11 Registered: December 2009 Location: Brazil
|
Junior Member |
|
|
Hi there,
problem solved!!
I just had to use xcopy within the command.com shell .
str := 'xcopy "long filename.jpg" "new file.jpg"';
host(str);
Xcopy recognizes long filenames while it works with short ones.
And still, it works copying across network.
[]'s to all
|
|
|
|
Re: host procedure on 6i [message #441003 is a reply to message #437061] |
Thu, 28 January 2010 05:41 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
beginnerHere
Messages: 55 Registered: October 2009
|
Member |
|
|
Hi,
I need a little help. I'm stuck with the same issue using the del command. Filenames or folder names of only 8 characters work.
eg I want to do HOST('DEL E:\NEW\NEWFILE108.TXT') and I'm unable to do that because of the above limitation.
I couldn't find any alternate command for del like for copy marceloy used xcopy.
Thanks in advance.
[Updated on: Thu, 28 January 2010 06:14] Report message to a moderator
|
|
|
|
|
Re: host procedure on 6i [message #441041 is a reply to message #441035] |
Thu, 28 January 2010 07:03 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
beginnerHere
Messages: 55 Registered: October 2009
|
Member |
|
|
hi,
Sorry, but I thought that since I have nearly the same problem as marceloy, I should post here. I thought maybe if I create a new thread then I might get some objection that I created a thread already discussed. My issue is with the same host procedure, giving me, atleast, the impression that I should post in this same thread if I want to get a quick efficient response. Anyhow, my apologies.
I'm using Forms 6i just the same as marceloy. The issue is with the host command just as marceloy did, but the only difference is that I have issues with the del command's usage within the host command.
By the way marceloy your feedback really helped me with copying files by using xcopy. Thanks.
Regards.
[Updated on: Thu, 28 January 2010 07:11] Report message to a moderator
|
|
|
Re: host procedure on 6i [message #441084 is a reply to message #441041] |
Thu, 28 January 2010 10:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21808 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
LOL, you're probably right; if you opened a new topic, you'd probably get the answer saying "Search". As far as I'm concerned, I don't mind you posting here. Moreover, it seems that @marceloy suffers from the same illness called 8+3, but this time while trying to delete a file.
I'm sorry, but I don't know the answer. All I had to say has already been said. Hopefully, you'll find a way, both of you.
|
|
|
|
|
|
Re: host procedure on 6i [message #673846 is a reply to message #445465] |
Wed, 12 December 2018 06:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.gravatar.com/avatar/89a886e1576f9821b2537f2aebeb191c?s=64&d=mm&r=g) |
nanaspecialist
Messages: 3 Registered: December 2018
|
Junior Member |
|
|
Why does Forms builder hangs when I changed my code from 'copy' to 'xcopy' to be able to rename more than 8 characters? I use 6i and our server is Win 2003 SP 2. Anybody who can help?
|
|
|