1834903 Members
2796 Online
110071 Solutions
New Discussion

directory link question

 
David Bell_1
Honored Contributor

directory link question

All,

I have what I think is a unique circumstance. Long story but an internal website using Oracle has placed a / after a directory location. This has caused the directory to show up as follows:

//oracle////cabo/styles/

** Note the // before "cabo"

Is there a way to do an ln -s or some other pointer to point it to the correct location which should look like:

//oracle///cabo/styles/

** Note the / before "cabo".

Thanks,

Dave
10 REPLIES 10
harry d brown jr
Honored Contributor

Re: directory link question

so you are saying that if I cd to
//oracle/

and do an

ls -l | grep

that comes out as /, where the / is part of the directory name?

have you tried

mv \/

??

of course you application is likely to fail to run because you changed the path.

or you could just cd to

cd //oracle//

ls -n \/

live free or die
harry d brown jr
Live Free or Die
Peter Nikitka
Honored Contributor

Re: directory link question

Hi,

I think there must be a directory containing (a) control character(s) below the second . Check the output of
cd //oracle//
ls | od -cx
If there is just one entry in this directory, then you can do a
ln -s */cabo cabo
else: Use a print/printf statement to put the name in a variable
var=$(printf '\0xx....')
You can test via ls "$var"...

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Bill Hassell
Honored Contributor

Re: directory link question

If this is just a reference to a directory path, don't worry about it. You can ls or cd to a directory like this:

cd ////var////tmp
ll /////etc///issue

And all is well. It is essentially a cosmetic feature. Does the reference work correctly in the web page database?


Bill Hassell, sysadmin
David Bell_1
Honored Contributor

Re: directory link question

Harry, Peter, and Bill,

Thank you for your time and responses. I think I should have been a bit more clear in my description.

Our Oracle application has a piece of poorly written code. When it should access a path with /u01/test/ it is actually coding it as /u01//test/.

I should note that we fixed this problem by modifying the code. At the time I originally sent this, we were seeking a quick and temporary fix. That was the reason for my question.

Now, I'm still curious if there is a way. If Oracle is looking for the path of /u01//test/, is there a way to create this "path" if the actual path is /u01/test/?

Something along the lines of:
ln -s /u01/test/ /u01//test/.

I hope that makes sense.

Thanks,

Dave
Bill Hassell
Honored Contributor

Re: directory link question

Since /u01/test/ and /u01//test/ are exactly the same file, then the ln command will fail because the link name already exists. Is this a cosmetic issue or does the link with double // not work at all? If it doesn't work, then the underlying code is using some unusual system call to establish the path. You should be able to type:

ls /u01/test/file
ls /u01/test///file
ls ///u01///test//file

and get exactly the same listing. Does the bad reference actually fail to resolve?


Bill Hassell, sysadmin
David Bell_1
Honored Contributor

Re: directory link question

Bill,

Yes the link actually fails to resolve. Somehow Oracle placed the extra "/" in there. As you pointed out, the OS doesn't care if I reference the fail by //file//. However, I believe this problem is created when the code attempts to access the path containing // in a string to call a style sheet.

Thanks again,

Dave
Bill Hassell
Honored Contributor

Re: directory link question

OK, I'm assuming that this link isn't stored (or you could just edit the appropriate record) but created by some code that feeds Oracle. A trailing / can be generated by using an ls command that has been aliased to ls -F (where directories have a trailing /, executables have a *, symlinks have @, and so on. Another possibility is with Apache config file options that may be modifying a directory reference.


Bill Hassell, sysadmin
David Bell_1
Honored Contributor

Re: directory link question

Bill,

I'll check with the web analyst and see if this would do the trick. I think it may. I'll get back to you as well as assign points. Thanks again,

Dave
David Bell_1
Honored Contributor

Re: directory link question

Bill,

I thank you again for your contributions both on this question as well as the forum in general. This problem is within Oracle and the code has been repaired. For now, that's simply going to have to be enough. I'm closing this but should I have available time in the near future, I may again solicit some advice.

Dave
David Bell_1
Honored Contributor

Re: directory link question

See note above.

Dave