This content has been marked as final. Show 11 replies
For copying and moving directories you can use the cp and mv commands just like you use them with files. Yeah, I know. If you've already tried to copy a directory with cp, you've probably noticed that cp just complains at you. Probably it says something like cp: omitting directory yadda yadda. You see, the cp command wants you to use the -r option if you want to copy a directory with its contents. The -r means "copy recursively":
$ cp -r dir1 dir2
The above creates a directory named dir2 whose contents will be identical to dir1. However, if dir2 already exists, nothing will be overwritten: the directory dir1 will be copied into the dir2 directory under the name dir2/dir1.
When renaming directories, you use the mv command exactly the same way as with files:
$ mv dir1 dir2
When dealing with directories, mv works a bit like cp does. If dir2 doesn't exist, the above will rename dir1 to dir2, but if dir2 exists, the directory dir1 will be moved into the dir2 directory under the name dir2/dir1.
But my problem here is, recently we have installed our application on Oracle Linux server, and we have JOB_DOCS folder there, and the users can upload files to this folder also. How can we copy the file test.pdf from JOB_DOCS to forms/java in linux?use cp inplace of copy in linux
And what could be the reson for the document cannot be accessed from the folder where it is saved? We tried giving folder permissions, adding the folder to PATH variable etc.could be due to permission or ownership issue,post error msg and file permission/ownership
Joe wrote:Ok you tired this and maybe its not working but Post error that appear to you should we guess it for you ???
That can be done in terminal, but how to use the same in forms?
are you saying that the below command should work in Linux?
HOST('cp ' ||'/u01/JOB_DOCS/test.pdf'||' '||'/u01/forms/java/test.pdf',NO_SCREEN);
I had tried this.......
Check these link
Running Copy command from Forms 6i
Hi I tried HOST('cp /docs/JOB_DOCS/test.pdf /docs/test.pdf'); //this is done on a button press
It is not even copying the file to one level above the current folder. But the same command works fine in the terminal.
I am not gettting any error messages also.......
since 'cp' is an operating system command, it should work right?
When you create directory, the default permissions are 755 or rwxr-xr-x. For example:
su - root
ls -ld /docs
drwxr-xr-x. 2 root root 4096 Sep 23 17:46 /docs
These permissions will allow anyone to list /docs, but will only allow root to create or copy files inside the /docs directory. Your application is most likely not running as root, and hence permissions are restricted by the user account under which the app is running. Perhaps you can correct the problem by assigning groups and setting appropriate permissions. However, there is not enough information your post to be able to pinpoint the issue.
Many thanks for all of yours comments and suggestions.........
Dude's comment helped me to resolve this.....
This was a problem with the directory permissions only.......initially i told that i checked permissions....so many of you might have ignored this....sorry for that.....even i was not aware of what Dude said in his comment.....earlier i tried giving permissions by right clicking on the directory and moving to the permissions tab, but this wasnt working.....this JOB_DOCS directory was created by selecting new folder from the file menu. I removed the directory and created this again through terminal window as weblogic user. Now the HOST('cp docs/JOB_DOCS/test.pdf /forms/java/test.pdf') is working perfectly.....