File_MoveTo()

… visits
Parent Previous Next

Syntax

File_MoveTo(pFileName As sSdTempName1, pDestDirName As sSdTempName2), Byte

Parameters

Parameter

Description

pFileName

file's name to move, must exist in the current directory

pDestDirName

sub-directory of the current directory to move it into

Return value

cErrOK: Succes

cErrNotFound

File not found.

cErrInUse

source file or dest dir missing

Overview

cErrExists (name collision)

            cErrRootDirFull

            cErrDiskFull

cErrRWError


Moves a file from the current directory into a sub-directory of the current directory


Moves a file from the current directory into a sub-directory of the current directory, on the SAME partition - a directory-entry-only operation (no file data is copied, the cluster chain is never touched), so cost is independent of file size.
The destination directory is not created if it doesn't exist.


Returns to the original directory when finished, regardless of outcome. 


Expands the destination directory with a fresh cluster if it's already full, mirroring FAT_DoNew()'s own expansion logic - but without allocating a data cluster, since the moved file's existing chain is untouched.

Example

File_MoveTo("temp.txt", "Home") 'Move file "temp.txt" to sub folder "Home"

Created with the Personal Edition of HelpNDoc: Maximize Your Documentation Capabilities with a Help Authoring Tool