symlink fails when basename(filename) is 6 chars long

John W. Eaton jwe at octave.org
Sat Jul 11 11:48:06 CDT 2009


On 11-Jul-2009, V.O. Dah wrote:

| Hi.
| I encountered a strange behaviour of the symlink function.
| Octave 3.2.0, linux i686.
| 
| Summary: 
| symlink fails when symbolik link to be created should point to
| a file having a 6 character long basename , *and* if the full filename is given  (i.e. including the full path). 
| 
| Demonstration:
| Shell, directory /home/alk : 
| touch 1
| touch 12
| touch 123
| touch 1234
| touch 12345
| touch 123456
| touch 1234567
| touch 12345678
| 
| In octave:
| octave:12> pwd
| ans = /home/alk
| 
| [er,me]=symlink("/home/alk/1","link1")
| [er,me]=symlink("/home/alk/12","link2")
| [er,me]=symlink("/home/alk/123","link3")
| [er,me]=symlink("/home/alk/1234","link4")
| [er,me]=symlink("/home/alk/12345","link5")
| [er,me]=symlink("/home/alk/123456","link6")
| [er,me]=symlink("/home/alk/1234567","link7")
| [er,me]=symlink("/home/alk/12345678","link8")
| 
| No error messages are reported.
| Result of ls -l in console: 
|  link1 -> /home/alk/1
|  link2 -> /home/alk/12
|  link3 -> /home/alk/123
|  link4 -> /home/alk/1234
|  link5 -> /home/alk/12345
|  link6 -> /home/alk/123456link6
|  link7 -> /home/alk/1234567
|  link8 -> /home/alk/12345678

Ouch, that's a bit embarrassing and has apparently been around for a
while.  I checked in the following change.

  http://hg.savannah.gnu.org/hgweb/octave/rev/bfc7b000a229

This should probably be applied to the 3.2.x branch too.

Thanks,

jwe


More information about the Bug-octave mailing list