]> gitweb.factorcode.org Git - factor.git/blob - basis/io/directories/windows/windows-tests.factor
99dcd0fe2f887b069e9d2034cf425ceeb2c84f04
[factor.git] / basis / io / directories / windows / windows-tests.factor
1 USING: accessors combinators io.directories io.files.temp
2 io.files.windows io.pathnames kernel math sequences tools.test
3 windows.kernel32 ;
4 IN: io.directories.windows.tests
5
6 { { +read-only+ +archive+ } } [
7     "read-only.file" temp-file {
8         [ ?delete-file ]
9         [ touch-file ]
10         [
11             FILE_ATTRIBUTE_READONLY FILE_ATTRIBUTE_ARCHIVE bitor
12             set-file-attributes
13         ]
14         [
15             parent-directory (directory-entries)
16             [ name>> "read-only.file" = ] find nip
17             attributes>>
18         ]
19     } cleave
20 ] unit-test