The Trunk: Files-ul.168.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Files-ul.168.mcz

commits-2
Levente Uzonyi uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-ul.168.mcz

==================== Summary ====================

Name: Files-ul.168
Author: ul
Time: 14 March 2017, 1:27:42.470961 am
UUID: ce489769-10b9-48e5-bc6f-86ee3a5a5eb4
Ancestors: Files-ul.167

- reverted some of the recent changes, because they may not work on other platforms

=============== Diff against Files-ul.167 ===============

Item was changed:
  ----- Method: DirectoryEntryDirectory>>asFileDirectory (in category 'convert') -----
  asFileDirectory
  "Answer a FileDirectory representing the same directory I represent."
+
+ ^directory on: (directory fullNameFor: name)!
-
- ^directory on: name!

Item was changed:
  ----- Method: FileDirectory>>directoryEntryForName: (in category 'private') -----
  directoryEntryForName: aFileName
 
  "Return a single DirectoryEntry for the given (non-path) entry name,
  or nil if the entry could not be found.
  Raises InvalidDirectoryError if this directory's path does not identify a directory."
 
  | entryArray sysPath sysName |
 
  sysPath := pathName asVmPathName.
  sysName := aFileName asVmPathName.
 
  "New linear-time primitive."
  entryArray := self primLookupEntryIn: sysPath name: sysName.
  entryArray == #primFailed ifFalse:[
  ^ entryArray ifNotNil: [(DirectoryEntry fromArray: entryArray directory: self) convertFromSystemName]
  ].
 
+ "(InvalidDirectoryError pathName: pathName) signal.
+ ^nil"
- (InvalidDirectoryError pathName: pathName) signal.
- ^nil
 
  "If the new primitive fails, use the old slow method.
  (This fallback can be changed to signal InvalidDirectoryError once
   VM's with FilePlugin #primitiveDirectoryEntry have been distributed everywhere;
+  the new primitive was introduced 6/13/2007."
-  the new primitive was introduced 6/13/2007.
 
  self isCaseSensitive
  ifTrue: [ self entriesDo: [ :entry | entry name = aFileName ifTrue: [ ^entry ] ] ]
  ifFalse: [ self entriesDo: [ :entry | (entry name sameAs: aFileName) ifTrue: [ ^entry ] ] ].
+ ^nil!
- ^nil"!

Item was changed:
  ----- Method: FileDirectory>>fileOrDirectoryExists: (in category 'file operations') -----
  fileOrDirectoryExists: filenameOrPath
  "Answer true if either a file or a directory file of the given name exists. The given name may be either a full path name or a local name within this directory."
  "FileDirectory default fileOrDirectoryExists: Smalltalk sourcesName"
 
  | fName dir |
  DirectoryClass splitName: filenameOrPath to:
  [:filePath :name |
  fName := name.
  filePath isEmpty
  ifTrue: [dir := self]
  ifFalse: [dir := FileDirectory on: filePath]].
 
+ ^ (dir includesKey: fName) or: [ fName = '' and:[ dir entries size > 1]]!
- ^(dir includesKey: fName) or: [ fName = '' and: [ dir hasEntries ] ]!