Поделиться через


_chdrive

Changes the current working drive.

int _chdrive( 
   int drive 
);

Параметры

  • drive
    Number of the new working drive.

Возвращаемое значение

_chdrive returns a value of 0 if the working drive is successfully changed. A return value of –1 indicates an error.

Заметки

The _chdrive function changes the current working drive to the drive specified by drive. The drive parameter uses an integer to specify the new working drive (1=A, 2=B, and so forth). This function changes only the working drive; _chdir changes the working directory.

If drive does not specify a valid drive, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, the function returns -1 and errno is set to EACCES, and _doserrno is set to ERROR_INVALID_DRIVE.

Требования

Routine

Required header

_chdrive

<direct.h>

For more compatibility information, see Compatibility in the Introduction.

Пример

See the example for _getdrive.

Эквивалент в .NET Framework

System::Environment::CurrentDirectory

См. также

Основные понятия

Directory Control

_chdir, _wchdir

_fullpath, _wfullpath

_getcwd, _wgetcwd

_getdrive

_mkdir, _wmkdir

_rmdir, _wrmdir

system, _wsystem