mirror of
https://github.com/aaru-dps/fstester.git
synced 2025-12-16 19:24:39 +00:00
In OS/2 change current drive before changing current directory.
This commit is contained in:
@@ -45,6 +45,17 @@ void ExtendedAttributes(const char* path)
|
||||
HFILE handle;
|
||||
char message[300];
|
||||
EAOP eap;
|
||||
USHORT driveNo = path[0] - '@';
|
||||
|
||||
if(driveNo > 32) driveNo -= 32;
|
||||
|
||||
rc = DosSelectDisk(driveNo);
|
||||
|
||||
if(rc)
|
||||
{
|
||||
log_write("Cannot change to specified drive, not continuing.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
drivePath[0] = path[0];
|
||||
drivePath[1] = ':';
|
||||
|
||||
@@ -47,6 +47,23 @@ void FileAttributes(const char* path)
|
||||
FILESTATUS3 fileStatus = {{0}};
|
||||
#endif
|
||||
|
||||
// 16 bit
|
||||
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
|
||||
USHORT driveNo = path[0] - '@';
|
||||
#else // 32 bit
|
||||
ULONG driveNo = path[0] - '@';
|
||||
#endif
|
||||
|
||||
if(driveNo > 32) driveNo -= 32;
|
||||
|
||||
rc = __os2_chdisk(driveNo);
|
||||
|
||||
if(rc)
|
||||
{
|
||||
log_write("Cannot change to specified drive, not continuing.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
drivePath[0] = path[0];
|
||||
drivePath[1] = ':';
|
||||
drivePath[2] = '\\';
|
||||
|
||||
@@ -44,6 +44,23 @@ void DeleteFiles(const char* path)
|
||||
ACTION_RET actionTaken = 0;
|
||||
HFILE handle;
|
||||
|
||||
// 16 bit
|
||||
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
|
||||
USHORT driveNo = path[0] - '@';
|
||||
#else // 32 bit
|
||||
ULONG driveNo = path[0] - '@';
|
||||
#endif
|
||||
|
||||
if(driveNo > 32) driveNo -= 32;
|
||||
|
||||
rc = __os2_chdisk(driveNo);
|
||||
|
||||
if(rc)
|
||||
{
|
||||
log_write("Cannot change to specified drive, not continuing.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
drivePath[0] = path[0];
|
||||
drivePath[1] = ':';
|
||||
drivePath[2] = '\\';
|
||||
|
||||
@@ -42,6 +42,23 @@ void DirectoryDepth(const char* path)
|
||||
char filename[9];
|
||||
int pos = 2;
|
||||
|
||||
// 16 bit
|
||||
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
|
||||
USHORT driveNo = path[0] - '@';
|
||||
#else // 32 bit
|
||||
ULONG driveNo = path[0] - '@';
|
||||
#endif
|
||||
|
||||
if(driveNo > 32) driveNo -= 32;
|
||||
|
||||
rc = __os2_chdisk(driveNo);
|
||||
|
||||
if(rc)
|
||||
{
|
||||
log_write("Cannot change to specified drive, not continuing.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
drivePath[0] = path[0];
|
||||
drivePath[1] = ':';
|
||||
drivePath[2] = '\\';
|
||||
|
||||
@@ -44,6 +44,23 @@ void Filenames(const char* path)
|
||||
char message[300];
|
||||
int pos = 0;
|
||||
|
||||
// 16 bit
|
||||
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
|
||||
USHORT driveNo = path[0] - '@';
|
||||
#else // 32 bit
|
||||
ULONG driveNo = path[0] - '@';
|
||||
#endif
|
||||
|
||||
if(driveNo > 32) driveNo -= 32;
|
||||
|
||||
rc = __os2_chdisk(driveNo);
|
||||
|
||||
if(rc)
|
||||
{
|
||||
log_write("Cannot change to specified drive, not continuing.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
drivePath[0] = path[0];
|
||||
drivePath[1] = ':';
|
||||
drivePath[2] = '\\';
|
||||
|
||||
@@ -44,6 +44,23 @@ void MillionFiles(const char* path)
|
||||
ACTION_RET actionTaken = 0;
|
||||
HFILE handle;
|
||||
|
||||
// 16 bit
|
||||
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
|
||||
USHORT driveNo = path[0] - '@';
|
||||
#else // 32 bit
|
||||
ULONG driveNo = path[0] - '@';
|
||||
#endif
|
||||
|
||||
if(driveNo > 32) driveNo -= 32;
|
||||
|
||||
rc = __os2_chdisk(driveNo);
|
||||
|
||||
if(rc)
|
||||
{
|
||||
log_write("Cannot change to specified drive, not continuing.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
drivePath[0] = path[0];
|
||||
drivePath[1] = ':';
|
||||
drivePath[2] = '\\';
|
||||
|
||||
@@ -49,6 +49,23 @@ void Fragmentation(const char* path, size_t clusterSize)
|
||||
HFILE handle;
|
||||
long i;
|
||||
|
||||
// 16 bit
|
||||
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
|
||||
USHORT driveNo = path[0] - '@';
|
||||
#else // 32 bit
|
||||
ULONG driveNo = path[0] - '@';
|
||||
#endif
|
||||
|
||||
if(driveNo > 32) driveNo -= 32;
|
||||
|
||||
rc = __os2_chdisk(driveNo);
|
||||
|
||||
if(rc)
|
||||
{
|
||||
log_write("Cannot change to specified drive, not continuing.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
drivePath[0] = path[0];
|
||||
drivePath[1] = ':';
|
||||
drivePath[2] = '\\';
|
||||
|
||||
@@ -76,12 +76,14 @@ Copyright (C) 2011-2021 Natalia Portillo
|
||||
#define __os2_chdir(path) DosChDir(path, 0)
|
||||
#define __os2_mkdir(path) DosMkDir(path, 0)
|
||||
#define __os2_delete(path) DosDelete(path, 0)
|
||||
#define __os2_chdisk(driveNumber) DosSelectDisk(driveNumber)
|
||||
|
||||
#else // 32 bit
|
||||
|
||||
#define __os2_chdir(path) DosSetCurrentDir(path)
|
||||
#define __os2_mkdir(path) DosCreateDir(path, NULL)
|
||||
#define __os2_delete(path) DosDelete(path)
|
||||
#define __os2_chdisk(driveNumber) DosSetDefaultDisk(driveNumber)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,11 +49,23 @@ void Timestamps(const char* path)
|
||||
#if(defined(__I86__) || defined(__i86__) || defined(_M_I86))
|
||||
USHORT status_size = sizeof(FILESTATUS);
|
||||
FILESTATUS status;
|
||||
USHORT driveNo = path[0] - '@';
|
||||
#else // 32 bit
|
||||
ULONG status_size = sizeof(FILESTATUS3);
|
||||
FILESTATUS3 status;
|
||||
ULONG driveNo = path[0] - '@';
|
||||
#endif
|
||||
|
||||
if(driveNo > 32) driveNo -= 32;
|
||||
|
||||
rc = __os2_chdisk(driveNo);
|
||||
|
||||
if(rc)
|
||||
{
|
||||
log_write("Cannot change to specified drive, not continuing.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
drivePath[0] = path[0];
|
||||
drivePath[1] = ':';
|
||||
drivePath[2] = '\\';
|
||||
|
||||
Reference in New Issue
Block a user