Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001049 [Squeak] Files major always 04-07-05 05:24 01-21-06 09:14
Reporter johnmci View Status public  
Assigned To cdegroot
Priority normal Resolution fixed  
Status closed   Product Version 3.8
Summary 0001049: oldFileOrNoneNamed: does not work with partial file names and non-default file directory
Description If you have a FileDirectory instance which is valid and attempt to open an existing file not in the default file directory, it fails however if you use readOnlyFileNamed: that works.

fileDirectoryFoobar oldFileOrNoneNamed: 'text.txt' "fails"
fileDirectoryFoobar readOnlyFileNamed: 'text.txt' "works"
why:

oldFileOrNoneNamed uses FileStream fullName: fileName which resolves to
 FileDirectory default fullNameFor: fileName which gives us the path to the default directory that is work, but if you attempt to test with files in the default directory it works
but
readOnlyFileNamed says
self fullNameFor: localFileName
which then considers the instances of fileDirectory you are using and builds the correct name.
Additional Information FileDirectory>>oldFileOrNoneNamed: fileName
    "If the file exists, answer a read-only FileStream on it. If it doesn't, answer nil."

    | fullName |
    fullName _ self fullNameFor: fileName.
    (FileStream concreteStream isAFileNamed: fullName)
        ifTrue: [^ FileStream concreteStream readOnlyFileNamed: fullName]
        ifFalse: [^ nil].
Attached Files

- Relationships

- Notes
(0002906 - 127 - 139 - 139 - 139 - 139 - 139)
cdegroot
10-19-05 23:01

Reproducible in 3.8, not reproducible in 3.9a.

Added test, and sent 3.8 maintainer patch. Committed to inbox as Files-CdG-12
 
(0003585 - 5 - 5 - 5 - 5 - 5 - 5)
MarcusDenker
01-21-06 09:14

fixed
 

- Issue History
Date Modified Username Field Change
04-07-05 05:24 johnmci New Issue
10-19-05 21:55 cdegroot Status new => assigned
10-19-05 21:55 cdegroot Assigned To  => cdegroot
10-19-05 22:24 cdegroot Category Kernel => Files
10-19-05 23:01 cdegroot Note Added: 0002906
10-19-05 23:02 cdegroot Status assigned => resolved
10-19-05 23:02 cdegroot Fixed in Version  => 3.9
10-19-05 23:02 cdegroot Resolution open => fixed
01-21-06 09:14 MarcusDenker Status resolved => closed
01-21-06 09:14 MarcusDenker Note Added: 0003585


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
44 total queries executed.
35 unique queries executed.
Powered by Mantis Bugtracker