Filename.st
changeset 16999 4d5ceea1cea6
parent 16787 c73dd3d9a002
child 17048 89053971191b
equal deleted inserted replaced
16998:54ee26519396 16999:4d5ceea1cea6
  1002      PCFilename new nameWithSpecialExpansions:'~foo'    
  1002      PCFilename new nameWithSpecialExpansions:'~foo'    
  1003      PCFilename new nameWithSpecialExpansions:'~foo\bar' 
  1003      PCFilename new nameWithSpecialExpansions:'~foo\bar' 
  1004     "
  1004     "
  1005 !
  1005 !
  1006 
  1006 
       
  1007 possiblyQuotedPathname:aPath
       
  1008     "return a filename path usable as command line argument,
       
  1009      by quoting in double quotes if there are any embedded special characters.
       
  1010      On Unix systems, special characters might also be prefixed by a backslash character."
       
  1011 
       
  1012     (aPath startsWith:'"') ifFalse:[
       
  1013         (aPath includes:Character space) ifTrue:[
       
  1014             ^ '"',aPath,'"'
       
  1015         ].
       
  1016     ].
       
  1017     ^ aPath
       
  1018 
       
  1019 
       
  1020     "
       
  1021      Filename possiblyQuotedPathname:'/tmp/bla'   
       
  1022      Filename possiblyQuotedPathname:'/tmp directory/bla'   
       
  1023      Filename possiblyQuotedPathname:'/tmp directory/bla file'   
       
  1024     "
       
  1025 !
       
  1026 
  1007 suggest:aFilenameString 
  1027 suggest:aFilenameString 
  1008     "return a fileNamestring based on the argument, 
  1028     "return a fileNamestring based on the argument, 
  1009      which is legal on the current platform."
  1029      which is legal on the current platform."
  1010 
  1030 
  1011     ^ self canonicalize:aFilenameString
  1031     ^ self canonicalize:aFilenameString
  6045 ! !
  6065 ! !
  6046 
  6066 
  6047 !Filename class methodsFor:'documentation'!
  6067 !Filename class methodsFor:'documentation'!
  6048 
  6068 
  6049 version
  6069 version
  6050     ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.426 2014-07-21 11:28:22 cg Exp $'
  6070     ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.427 2014-11-08 09:05:49 cg Exp $'
  6051 !
  6071 !
  6052 
  6072 
  6053 version_CVS
  6073 version_CVS
  6054     ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.426 2014-07-21 11:28:22 cg Exp $'
  6074     ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.427 2014-11-08 09:05:49 cg Exp $'
  6055 ! !
  6075 ! !
  6056 
  6076 
  6057 
  6077 
  6058 Filename initialize!
  6078 Filename initialize!