Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!valley From: valley@uchicago (Doug Dougherty) Newsgroups: comp.os.msdos.programmer Subject: Re: Another TC findfirst()/findnext() question Keywords: Turbo C findfirst findnext Message-ID: Date: 27 Feb 91 15:30:33 GMT References: <1991Feb27.142204.22379@javelin.es.com> Sender: news@midway.uchicago.edu (News Administrator) Organization: University of Chicago Lines: 71 bgeer@javelin.es.com (Bob Geer) writes: >While writing my own file move routine for moving/renaming a file to >another directory (without copy-deleting) I found I couldn't move or >rename directories. I haven't had the time to pursue it yet...will >some magic combination of file attribute bits make this possible? >TIA! Apparently, you have to use the FCB rename call. Below is a disassembly of a program called RENDIR.COM, which I had laying around. Interestingly, this program will rename anything, not just directories... Hope this helps... ---cute (sic) here--- PAGE 59,132 ;[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ ;[[ [[ ;[[ RENDIR [[ ;[[ [[ ;[[ Created: 17-Feb-87 [[ ;[[ Version: [[ ;[[ Passes: 5 Analysis Options on: none [[ ;[[ [[ ;[[ [[ ;[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ .err Target Assembler set to NONE, re-assembly not recomended data_1e equ 55h ; (8E18:0055=0) seg_a segment byte public assume cs:seg_a, ds:seg_a org 100h rendir proc far start: mov di,data_1e ; (8E18:0055=0) mov dx,di mov ax,0FFh cld ; Clear direction stosw ; Store ax to es:[di] inc al stosw ; Store ax to es:[di] stosw ; Store ax to es:[di] mov byte ptr [di],10h mov ah,17h int 21h ; DOS Services ah=function 17h ; rename file, FCB @ ds:dx or al,al ; Zero ? jz loc_1 ; Jump if zero mov dx,offset data_2 ; (8E18:0122=52h) mov ah,9 int 21h ; DOS Services ah=function 09h ; display char string at ds:dx loc_1: int 20h ; Program Terminate data_2 db 'Rename error$' db 81 dup (1Ah) rendir endp seg_a ends end start