Revision [161]

This is an old revision of sqGetFilenameFromString made by JohnMcIntosh on 2008-10-16 20:30:14.


sqInt sqGetFilenameFromString(char * aCharBuffer, char * aFilenameString, sqInt filenameLength, sqInt resolveAlias)

aCharBuffer location to put encoded C string.
aFilenameString location of the squeak encoded byte string containing the file name
filenameLength length of the file name in aFilenameString
resolveAlias. True if we should resolve any alias file information

return: NONE, fake return of zero
From: Interpreter, file plugin
Why: To decode squeak file name to platform encoding and resolve aliases
Typically take the file/path bytes and convert from the image character encoding to the platform encoding
On the macintosh and unix systems if resolveAlias is TRUE we must resolve the path/file name as a possible alias (symbolic link, or other form).

For example
sqFileDeleteNameSize, sqFileRenameOldSizeNewSize both say not to resolve the alias because we want to delete or rename the alias file
not the target.

sqFileOpen does call with true to resolve the alias because we want to open the target of the alias file, not the alias file.
Note that on unix opening a symbolic link would open the target of the symbolic link, but on os-9/os-x opening an alias file does not imply opening the target of the alias file.

Note the issues with os-9 alias files, which are files that contain location information about where to find the actual file. The target file could be on any attached volume, or on a remote appleshare server. This file type is different than hard or soft linked unix files. When using unix calls we need to beware of wanting to delete say the target of the alias file, or do we want to delete the alias file.

Bugs: multiple macintosh finder alias files in a path, require decomposing the path and traversing level by level resolving the path incrementally since the API calls are not able to solve such complexity (NOTE need to retest with current OSX)


Only supports UTF8 file names
Does not support os-9 alias files

Invoke sq2uxPath to get unix platform encoding, then if resolveAlias attempt to resolve to the actual path if the path points to an symbolic link.
If Darwin then attempt to resolve any os-9 alias files.

Bugs: multiple os-9 alias file indirections in the path cause failure.


There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki