Filename.st
changeset 10557 2288b6652a8c
parent 10551 4924bf1ce2e3
child 10583 71c4724f0b29
equal deleted inserted replaced
10556:fb4ea1df1f1d 10557:2288b6652a8c
  1823 !
  1823 !
  1824 
  1824 
  1825 directories
  1825 directories
  1826     "return a collection of directories contained in the directory represented by the receiver."
  1826     "return a collection of directories contained in the directory represented by the receiver."
  1827 
  1827 
  1828     ^ self directoryContentsAsFilenames select:[:eachFileOrDirectory | eachFileOrDirectory isDirectory]
  1828     ^ self directoryContentsAsFilenames 
       
  1829         select:[:eachFileOrDirectory | eachFileOrDirectory isDirectory]
  1829 
  1830 
  1830     "
  1831     "
  1831      '.' asFilename directories.
  1832      '.' asFilename directories.
  1832     "
  1833     "
       
  1834 
       
  1835     "Modified: / 29-05-2007 / 12:02:56 / cg"
  1833 !
  1836 !
  1834 
  1837 
  1835 directoriesDo:aBlock
  1838 directoriesDo:aBlock
  1836     "evaluate aBlock for directories contained in the directory represented by the receiver.
  1839     "evaluate aBlock for directories contained in the directory represented by the receiver.
  1837      The block is invoked with a filename-arguments.
  1840      The block is invoked with a filename-arguments.
  1918 !
  1921 !
  1919 
  1922 
  1920 files
  1923 files
  1921     "return a collection of files contained in the directory represented by the receiver."
  1924     "return a collection of files contained in the directory represented by the receiver."
  1922 
  1925 
  1923     ^ self directoryContentsAsFilenames select:[:eachFileOrDirectory | eachFileOrDirectory isDirectory not]
  1926     ^ self directoryContentsAsFilenames 
       
  1927         select:[:eachFileOrDirectory | eachFileOrDirectory isDirectory not]
  1924 
  1928 
  1925     "
  1929     "
  1926      '.' asFilename files.
  1930      '.' asFilename files.
  1927     "
  1931     "
       
  1932 
       
  1933     "Modified: / 29-05-2007 / 12:02:15 / cg"
  1928 !
  1934 !
  1929 
  1935 
  1930 filesDo:aBlock
  1936 filesDo:aBlock
  1931     "evaluate aBlock for all files contained in the directory represented by the receiver."
  1937     "evaluate aBlock for all files contained in the directory represented by the receiver."
  1932 
  1938 
  1933     ^ self directoryContentsAsFilenames do:[:eachFileOrDirectory | 
  1939     ^ self directoryContentsAsFilenames 
  1934         eachFileOrDirectory isDirectory ifFalse:[ aBlock value: eachFileOrDirectory]
  1940         do:[:eachFileOrDirectory | 
  1935     ].
  1941             eachFileOrDirectory isDirectory ifFalse:[ aBlock value: eachFileOrDirectory]].
  1936 
  1942 
  1937     "
  1943     "
  1938      '.' asFilename filesDo:[:f | Transcript showCR:f].
  1944      '.' asFilename filesDo:[:f | Transcript showCR:f].
  1939     "
  1945     "
  1940 
  1946 
  1941     "Created: / 29-08-2006 / 11:03:15 / cg"
  1947     "Created: / 29-08-2006 / 11:03:15 / cg"
       
  1948     "Modified: / 29-05-2007 / 12:02:46 / cg"
  1942 !
  1949 !
  1943 
  1950 
  1944 recursiveDirectoryContentsDo:aBlock 
  1951 recursiveDirectoryContentsDo:aBlock 
  1945     "evaluate aBlock for all files and directories found under the receiver.
  1952     "evaluate aBlock for all files and directories found under the receiver.
  1946      The block is invoked with a string-argument.
  1953      The block is invoked with a string-argument.
  5492 ! !
  5499 ! !
  5493 
  5500 
  5494 !Filename class methodsFor:'documentation'!
  5501 !Filename class methodsFor:'documentation'!
  5495 
  5502 
  5496 version
  5503 version
  5497     ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.314 2007-05-28 11:51:17 stefan Exp $'
  5504     ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.315 2007-05-29 10:03:45 cg Exp $'
  5498 ! !
  5505 ! !
  5499 
  5506 
  5500 Filename initialize!
  5507 Filename initialize!