1 ; SCCSID = @(#)finfo.asm 1.1 85/04/11
2 TITLE FILE_INFO
- Internal Get
/Set
File Info routines
4 ; Low level routines for returning file information and setting file
10 ; Modification history:
12 ; Created: ARR 30 March 1983
16 ; get the appropriate segment definitions
21 CODE SEGMENT BYTE PUBLIC 'CODE'
22 ASSUME
SS:DOSGROUP
,CS:DOSGROUP
38 I_need EXTERR_CLASS
,BYTE
39 I_need EXTERR_ACTION set
40 I_need EXTERR_LOCUS
,BYTE
42 i_need FastOpenFlg
,BYTE
44 SUBTTL GET_FILE_INFO
-- Get
File Information
48 ; [WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
50 ; [CURR_DIR_END] Points to end of Current dir part of string
51 ; ( = -1 if current dir not involved, else
52 ; Points to first char after last "/" of current dir part)
53 ; [THISCDS] Points to CDS being used
54 ; (Low word = -1 if NUL CDS (Net direct request))
55 ; [SATTRIB] Is attribute of search, determines what files can be found
57 ; Get Information about a file
60 ; AX = Attribute of file
61 ; CX = Time stamp of file
62 ; DX = Date stamp of file
63 ; BX:DI = Size of file (32 bit)
66 ; error_file_not_found
67 ; Last element of path not found
68 ; error_path_not_found
69 ; Bad path (not in curr dir part if present)
71 ; Bad path in current directory part of path
72 ; DS preserved, others destroyed
74 procedure GET_FILE_INFO
,NEAR
75 DOSAssume
CS,<DS>,"Get_File_Info"
80 ; invoke OWN_SHARE2 ;IFS. IFS owns share ? ;AN000;
81 ; JZ ifsshare ;IFS. yes ;AN000;
82 ; PUSH WORD PTR [DMAADD+2] ;IFS. save DMAADD ;AN000;
83 ; PUSH WORD PTR [DMAADD] ;IFS. ;AN000;
84 ; invoke IFS_SEARCH_FIRST ;IFS. do search first ;AN000;
85 ; JC nofiles ;IFS. file not existing ;AN000;
86 delete_next_file: ;IFS. ;AN000;
87 ; invoke IFS_REN_DEL_CHECK ;IFS. do REN_DEL_CHECK ;AN000;
88 ; JNC share_okok ;IFS. share ok ;AN000;
89 ; MOV AX,error_sharing_violation ;IFS. share violation ;AN000;
90 ; JMP SHORT nofiles ;IFS. ;AN000;
92 ; POP WORD PTR [DMAADD] ;IFS. retor DMAADD ;AN000;
93 ; POP WORD PTR [DMAADD+2] ;IFS. ;AN000;
96 transfer NET_GET_FILE_INFO
98 MOV AX,(multNET
SHL 8) OR 15
103 ; POP WORD PTR [DMAADD] ;IFS. retor DMAADD ;AN000;
104 ; POP WORD PTR [DMAADD+2] ;IFS. ;AN000;
109 MOV [NoSetDir
],1 ; if we find a dir, don't change to it
115 DOSAssume
CS,<DS>,"FINFO/No_Path"
122 MOV AX,error_file_not_found
130 MOV AX,error_path_not_found
135 JS info_no_file
; device
137 MOV DS,WORD PTR [CURBUF
+2]
140 XOR BX,BX ; Assume size=0 (dir)
146 TEST AL,attr_directory
148 MOV DI,[SI.dir_size_l
]
149 MOV BX,[SI.dir_size_h
]
154 EndProc GET_FILE_INFO
156 Break <SET_FILE_ATTRIBUTE
-- Set
File Attribute
>
159 ; [WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
161 ; [CURR_DIR_END] Points to end of Current dir part of string
162 ; ( = -1 if current dir not involved, else
163 ; Points to first char after last "/" of current dir part)
164 ; [THISCDS] Points to CDS being used
165 ; (Low word = -1 if NUL CDS (Net direct request))
166 ; [SATTRIB] is attribute of search (determines what files may be found)
167 ; AX is new attributes to give to file
169 ; Set File Attributes
175 ; error_file_not_found
176 ; Last element of path not found
177 ; error_path_not_found
178 ; Bad path (not in curr dir part if present)
180 ; Bad path in current directory part of path
181 ; error_access_denied
182 ; Attempt to set an attribute which cannot be set
183 ; (attr_directory, attr_volume_ID)
184 ; error_sharing_violation
185 ; Sharing mode of file did not allow the change
186 ; (this request requires exclusive write/read access)
187 ; (INT 24H generated)
188 ; DS preserved, others destroyed
190 procedure SET_FILE_ATTRIBUTE
,NEAR
191 DOSAssume
CS,<DS>,"Set_File_Attribute"
194 TEST AX,NOT attr_changeable
197 MOV ExtErr_Locus
,errLoc_UNK
198 MOV ExtErr_Class
,errClass_Apperr
199 MOV ExtErr_Action
,errAct_Abort
200 MOV AX,error_access_denied
209 transfer NET_SEQ_SET_FILE_ATTRIBUTE
212 MOV AX,(multNET
SHL 8) OR 14
220 PUSH AX ; Save new attributes
221 MOV [NoSetDir
],1 ; if we find a dir, don't change to it
222 invoke GetPath
; get path through fastopen if there ;AC000;
224 POP BX ; Clean stack (don't zap AX)
235 POP AX ; Get new attributes
238 MOV AX,error_sharing_violation
243 AND BYTE PTR ES:[BX].dir_attr
,NOT attr_changeable
244 OR BYTE PTR ES:[BX].dir_attr
,AL
246 TEST ES:[DI.buf_flags
],buf_dirty
;LB. if already dirty ;AN000;
247 JNZ yesdirty
;LB. don't increment dirty count ;AN000;
248 invoke INC_DIRTY_COUNT
;LB. ;AN000;
249 OR ES:[DI.buf_flags
],buf_dirty
252 ;;;; 10/1/86 F.C update fastopen cache
255 MOV AH,0 ; dir entry update
256 MOV DL,AL ; drive number A=0,B=1,,
257 MOV DI,BX ; ES:DI -> dir entry
258 invoke FastOpen_Update
261 ;;;; 9/11/86 F.C update fastopen cache
264 MOV AX,error_file_not_found
269 EndProc SET_FILE_ATTRIBUTE
273 procedure GET_FAST_PATH
,NEAR
274 ASSUME
DS:NOTHING
,ES:NOTHING
276 OR [FastOpenFlg
],FastOpen_Set
;FO. trigger fastopen ;AN000;
279 AND [FastOpenFlg
],Fast_yes
;FO. clear all fastopen flags ;AN000;
283 EndProc GET_FAST_PATH