File links in Unix VM broken?

John M McIntosh johnmci at smalltalkconsulting.com
Thu Nov 8 05:06:26 UTC 2007


Well did you look into

sqFileOpen

in
sqFilePluginBasicPrims.c

at the point where it does the

fopen(cFileName, "....

what does it think cFileName  is?

mind don't forget it takes whatever squeak hands it and grinds thru

sqGetFilenameFromString() before giving to fopen(

See sqUnixMain.c



On Nov 7, 2007, at 8:05 PM, Andreas Raab wrote:

> Hi -
>
> I had an interesting problem today. I had created a directory with  
> a plain file like
>
> /foo/bar/plainfile
>
> and then added a subdirectory with a relative link to that file:
>
> /foo/bar/baz/link -> ../plainfile
>
> The link would be listed in the the directory listing primitives  
> but would fail to open (although bash and any other unix tool would  
> work just fine with it). When I played around a little more I found  
> that the VM was trying to open /foo/plainfile instead of /foo/bar/ 
> plainfile (placing a test file in the location confirmed that) so  
> it seems as if the Unix file code doesn't deal correctly with "up  
> links" (going one hop too many). Any ideas how to fix that? I can  
> work around it easy enough now that I know it but it'd be good if  
> the problem could be fixed in general.
>
> Cheers,
>   - Andreas
>

--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===





More information about the Squeak-dev mailing list