how to check a directory exist and can write file

1.9k views Asked by At
  1. I need to check directory test_file exist, if yes then need to check directory test_file is having write permission so that files will be writen in the same.

this functionality i needed in shell script(ksh).

  1. What would be return code from sqlldr for single table load and multi table load method , when there is an error due to

i.logon issue

ii. table does not exist

iii.less no of columns/data issue

iv.if any bad file generation

1

There are 1 answers

0
Pravin Satav On BEST ANSWER

For Checking Diretory is present

if [ -d "$YOUR_DIRECTORY" ]
then
#Operation when directory is present
else
#Operation when directory is not present
fi

For checking if directory is writeable

if [ -w "$YOUR_DIRECTORY"] 
then 
#Operation when directory is writeable
else
#Operation when directory is not writeable
fi

Regarding Oracle error code, you can try on your own if you have the environment.