1
2 attr: func [
3 {Return current attributes for the file.}
4 file [file!]
5 /with {Retrieve only selected attributes.}
6 sel {Selected attributes to retrieve.}
7 /avail {Return a list of attributes available for the file.}
8 /copy {Copy all attributes, which are safe to copy, to f2.}
9 f2 [file!]
10 /local a
11 ][
12 if with [return get-modes file sel]
13 if avail [return get-modes file 'file-modes]
14 if copy [
15 ;set-modes f2 a: get-modes file get-modes file 'copy-modes
16 ; Core 2.5 includes full-path, which it shouldn't
17 ;set-modes f2 a: get-modes file exclude get-modes file 'copy-modes [full-path]
18 set-modes f2 a: get-modes file get-modes file 'copy-modes
19 return a
20 ]
21 get-modes file get-modes file 'file-modes
22 ]