www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/19/23:54:46

Date: Mon, 19 Jan 1998 13:26:54 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Davide Rossi <rossi AT cs DOT unibo DOT it>
cc: djgpp AT delorie DOT com
Subject: Re: moving a file
In-Reply-To: <69ubvo$ebi@leporello.cs.unibo.it>
Message-ID: <Pine.SUN.3.91.980119132310.21533A-100000@is>
MIME-Version: 1.0

On 19 Jan 1998, Davide Rossi wrote:

> I have to implement a move file operation in a program I'm writing.

Use the ANSI-standard function `rename'.  It's part of DJGPP library.

> With dos interrupts the only thing I've been able to find is a win95 (long
> file names) operation, and I'd like to avoid that.

`rename' will use whatever appropriate (long file name function when long 
names are supported, short names otherwise).  I don't see how this should 
be of any concern to the application.

> Copying the file then removing the source is slow and messy

But it's the only way to go when you need to move a file to another 
disk.  So if moving files to another disk is required, you will need to 
watch the status returned by `rename', and if it indicates a failure, use 
the copy/delete thing instead.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019