Marcel Taeumel uploaded a new version of Files to project The Trunk: http://source.squeak.org/trunk/Files-mt.205.mcz
==================== Summary ====================
Name: Files-mt.205 Author: mt Time: 31 August 2023, 2:45:15.602117 pm UUID: f266e8ba-65e3-6c43-9f32-cb92acce32ab Ancestors: Files-mt.204
Adds commentary for path-lookup edge case on Windows platform.
For the changed win32 platform code, see OSVM commit 330d6779ad2ecbce1f07131f53d75cd168165f0b
Complements VMMaker.oscog-mt.3336 (only commentary)
=============== Diff against Files-mt.204 ===============
Item was changed: FileDirectory subclass: #DosFileDirectory instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Files-Directories'!
+ !DosFileDirectory commentStamp: 'ct 8/17/2023 13:25' prior: 0! + I represent a DOS or Windows FileDirectory. Paths follow the usual syntax for Microsoft Windows, including a length limit to 260 characters. Above these limit, the VM falls back to UNC paths, which however do not support syntactic sugar in paths such as '.', '..', or forward slashes instead of backward slashes. See examples in my primitive methods. Thus, any primitive call for a possibly long path should not contain such syntactic sugar. Perspectively, this class should wipe out all this sugar during construction (normalization).! - !DosFileDirectory commentStamp: '<historical>' prior: 0! - I represent a DOS or Windows FileDirectory. - !
Item was changed: ----- Method: FileDirectory>>primLookupEntryIn:index: (in category 'private') ----- primLookupEntryIn: fullPath index: index "Look up the index-th entry of the directory with the given fully-qualified path (i.e., starting from the root of the file hierarchy) and return an array containing:
<name> <creationTime> <modificationTime> <dirFlag> <fileSize>
The empty string enumerates the top-level files or drives. (For example, on Unix, the empty path enumerates the contents of '/'. On Macs and PCs, it enumerates the mounted volumes/drives.) + Note that in general, fullPath must not contain syntactic sugar for the current platform (e.g., '.' or '..', or on Windows, forward slashes instead of backslashes). These conventions are only fully supported on Unix platforms; on Windows, they are only supported for short non-UNC file paths containing max 260 characters: + DON'T: self primLookupEntryIn: '<very long path>\foo.' index: ... + DON'T: self primLookupEntryIn: '<very long path>\foo..' index: ... + DON'T (on Windows): self primLookupEntryIn: '<very long path>\foo/bar' index: ... + See the comment in the primitive implementation for more details.
The creation and modification times are in seconds since the start of the Smalltalk time epoch. DirFlag is true if the entry is a directory. FileSize the file size in bytes or zero for directories. The primitive returns nil when index is past the end of the directory. It fails if the given path is bad."
<primitive: 'primitiveDirectoryLookup' module: 'FilePlugin'> ^ #badDirectoryPath
!
Item was changed: ----- Method: FileDirectory>>primLookupEntryIn:name: (in category 'private') ----- primLookupEntryIn: fullPath name: fName - "Look up <fName> (a simple file name) in the directory identified by <fullPath> and return an array containing:
<fName> <creationTime> <modificationTime> <dirFlag> <fileSize>
On Unix, the empty path denotes '/'. On Macs and PCs, it is the container of the system volumes.) + Note that in general, neither fullPath nor fName must contain syntactic sugar for the current platform (e.g., '.' or '..', or on Windows, forward slashes instead of backslashes). These conventions are only fully supported on Unix platforms; on Windows, they are only supported for short non-UNC file paths containing max 260 characters (for the full path concatenated from the directory path, a backslash, and the file name). As a single (!!) exception, the file name may always be a single dot ('.'), which is supported for an efficient existence test of the directory path (e.g., FileDirectory>>#exists): + DON'T: self primLookupEntryIn: '<very long path>' name: 'plonk.'. + DON'T: self primLookupEntryIn: '<very long path>' name: 'plonk..'. + DON'T (on Windows): self primLookupEntryIn: '<very long path>' name: 'foo/bar'. + DO: self primLookupEntryIn: '<very long path>' name: '.'. + See the comment in the primitive implementation for more details.
The creation and modification times are in seconds since the start of the Smalltalk time epoch. DirFlag is true if the entry is a directory. FileSize the file size in bytes or zero for directories. The primitive returns nil when index is past the end of the directory. It fails if the given path is bad."
<primitive: 'primitiveDirectoryEntry' module: 'FilePlugin'>
^ #primFailed "to distinguish from nil"
!
packages@lists.squeakfoundation.org