Revision [125]

This is an old revision of dirLookup made by JohnMcIntosh on 2008-10-15 00:49:55.


sqInt dir_Lookup(char *pathString, sqInt pathStringLength, sqInt index, char *name, sqInt *nameLength, sqInt *creationDate, sqInt *modificationDate,

pathString squeak object, file name, in encoding according to image choice
pathStringLength length of squeak object
index index number which is 1-N ;

0 if a entry is found at the given index
1 if the directory has fewer than index entries
2 if the given path has bad syntax or does not reach a directory
Pointers return
name 256 bytes, name of entry, encoded according to image choice
nameLength length of name
creationDate creation Date of the file in squeak date form
modificationDate Modification Date of the file in squeak date form
isDirectory 1 if entry is a directory, zero otherwise
sizeIfFile size of file, or zero. In squeakFileOffsetType which resolves to operating system file size typedef

From: Interpreter FilePlugin primitiveDirectoryLookup
Why: Need to get Nth entry of given directory.
Must return directory entry, on unix it must beware of symbolic links, on os-x it must beware of Finder Aliases.
If the pathString is empty then you return the contents of the current working directory (whatever that means for the platform)
If the pathString does not encode for the file system then return BAD_PATH
If the directory cannot be opened then return BAD_PATH
Attempt to read the "index" directory entry, if unable then return NO_MORE_ENTRIES.
If we find a directory entry then return the encoded directory name, which is not say a resolved symbolic link or alias name
and the length, the creation/modification time in squeak time, and if it is a directory and the size of the file (directories may be zero)







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