Revision history for dirLookup


Revision [405]

Last edited on 2010-09-12 21:16:57 by JohnMcIntosh
Additions:
See iPhone
Deletions:
TBD


Revision [130]

Edited on 2008-10-15 02:05:38 by JohnMcIntosh
Additions:
UNKNOWN how it handles the case where the path name is empty (aka unix working directory)


Revision [129]

Edited on 2008-10-15 02:03:07 by JohnMcIntosh
Additions:
If we find a directory entry then return the encoded directory name, which is not the resolved symbolic link or alias name
The code also caches the directory for faster N+1 usage
Deletions:
If we find a directory entry then return the encoded directory name, which is not the a resolved symbolic link or alias name


Revision [128]

Edited on 2008-10-15 01:28:58 by JohnMcIntosh
Additions:
If the stat AND the lstat fails on the file name, it returns ENTRY_FOUND however the create/modification dates and if directory and size of file are all zero.
Deletions:
If the stat or lstat fails on the file name, it returns ENTRY_FOUND however the create/modification dates and if directory and size of file are all zero.


Revision [127]

Edited on 2008-10-15 01:24:01 by JohnMcIntosh
Additions:
Ensure return values are zero to NULL/0 so that caller does not have bogus values if we return BAD_PATH or NO_MORE_ENTRIES
If we find a directory entry then return the encoded directory name, which is not the a resolved symbolic link or alias name
and the length of the encoded name, the creation/modification time in squeak time, and if it is a directory and the size of the file (directories may be zero)
If the code attempts to cache the directory information, it must deal with knowing when to invalidate the cache.
{On a dir_Delete we must ensure the cached directory is invalidated.}
Deletions:
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)
If the code attempts to cache the directory information it must deal with knowing when to invalidate the cache.
On a dir_Delete we must ensure the cached directory is invalidated.


Revision [126]

Edited on 2008-10-15 00:52:05 by JohnMcIntosh
Additions:
**Issues**:
If the directory changes during iterations then the result is unknown.
If the code attempts to cache the directory information it must deal with knowing when to invalidate the cache.
A platform might not have the concept of a working directory
On a dir_Delete we must ensure the cached directory is invalidated.
The macintosh port uses a version of the unix code but is more aware of Finder Aliases.
For example when calculating if the entry is a directory it invokes FSResolveAliasFileWithMountFlags since otherwise
a Finder alias file that points to a directory would show as a file, since it is technically a file.
BUG: unsure if resource fork entries '._foobar' would show in directory listing.
NSUTF8StringEncoding is the only file encoding
we read and cache the directory listing, later lookup of a name may fail. It's unclear what to do
it ignores resource fork entries that start with '._', also '.' and '..'
Bugs: if Finder alias is directory entry, it will not be marked as a directory entry. {NEED TO CONFIRM}
The unix port has some complicated code to ensure it opens the directory then caches the directory and last index number
on the next read it has to decide if the directory should be closed, reopened, or rewind, then read to the entry, or get
the next entry if it is in fact reading from 1 to N in a loop.
It's unclear if the opendir() give you a read stream on a directory that is not affected by other processes manipulation of the directory?
If the stat or lstat fails on the file name, it returns ENTRY_FOUND however the create/modification dates and if directory and size of file are all zero.
Directory entries are returned with file size of zero.
It also skips over '.' and '..' in the directory entries.
Bugs: on OSX if Finder alias is directory entry, it will not be marked as a directory entry.


Revision [125]

Edited on 2008-10-15 00:49:55 by JohnMcIntosh
Additions:
**Parms**:
pathString squeak object, file name, in encoding according to image choice
pathStringLength length of squeak object
index index number which is 1-N ;
**return**:
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)
Deletions:
**Parms**: NONE
**return**: NONE, fake return of zero
**From**: Interpreter
**Why**:


Revision [124]

The oldest known version of this page was created on 2008-10-15 00:47:41 by JohnMcIntosh
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki