Filename.st
changeset 11784 dc0f068adfd6
parent 11781 6488fd6cc498
child 11877 aa347ed8ce60
equal deleted inserted replaced
11783:50af8c293ecc 11784:dc0f068adfd6
  1754      'c:' asFilename asAbsoluteFilename
  1754      'c:' asFilename asAbsoluteFilename
  1755     "
  1755     "
  1756 !
  1756 !
  1757 
  1757 
  1758 asAutoDeletedFilename
  1758 asAutoDeletedFilename
  1759     ^ AutoDeletedFilename named:self name
  1759     ^ AutoDeletedFilename basicNew setName:self name
  1760 !
  1760 !
  1761 
  1761 
  1762 asCanonicalizedFilename
  1762 asCanonicalizedFilename
  1763     "return the receiver converted to a filename without intermediate ..'s and .'s
  1763     "return the receiver converted to a filename without intermediate ..'s and .'s
  1764      (similar to an absolute pathname, but symlinks are not resolved)."
  1764      (similar to an absolute pathname, but symlinks are not resolved)."
  3496      The argument may not specify an absolute path name.
  3496      The argument may not specify an absolute path name.
  3497      Please do not use this to create filenames with suffixes,
  3497      Please do not use this to create filenames with suffixes,
  3498      since some systems require special naming conventions.
  3498      since some systems require special naming conventions.
  3499      See also: #withSuffix: (which is different, but often needed)."
  3499      See also: #withSuffix: (which is different, but often needed)."
  3500 
  3500 
  3501     ^ self class named:(self constructString:subname)
  3501     |constructedName|
       
  3502 
       
  3503     constructedName := self constructString:subname.
       
  3504     ^ self class named:constructedName.
  3502 
  3505 
  3503     "
  3506     "
  3504      '/tmp' asFilename construct:'foo'    
  3507      '/tmp' asFilename construct:'foo'    
  3505      '/' asFilename construct:'foo'         
  3508      '/' asFilename construct:'foo'         
  3506      '/usr/tmp' asFilename construct:'foo'
  3509      '/usr/tmp' asFilename construct:'foo'
  3507      '/foo/bar' asFilename construct:'baz' 
  3510      '/foo/bar' asFilename construct:'baz' 
  3508      '/foo/bar' asFilename construct:'baz' asFilename 
  3511      '/foo/bar' asFilename construct:'baz' asFilename 
  3509 
  3512 
  3510      Bad example; works on UNIX, but may not on others:
  3513      Bad example; works on UNIX, but may not on others:
  3511        'foo/bar.baz' construct:'.suff'
  3514        'foo/bar.baz' asFilename construct:'.suff'
  3512     "
  3515     "
  3513 
  3516 
  3514     "Modified: 29.2.1996 / 20:55:06 / cg"
  3517     "Modified: 29.2.1996 / 20:55:06 / cg"
  3515 !
  3518 !
  3516 
  3519 
  5703 ! !
  5706 ! !
  5704 
  5707 
  5705 !Filename class methodsFor:'documentation'!
  5708 !Filename class methodsFor:'documentation'!
  5706 
  5709 
  5707 version
  5710 version
  5708     ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.341 2009-06-22 21:12:13 stefan Exp $'
  5711     ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.342 2009-06-22 21:56:50 stefan Exp $'
  5709 ! !
  5712 ! !
  5710 
  5713 
  5711 Filename initialize!
  5714 Filename initialize!