mirror of
https://github.com/aaru-dps/fstester.git
synced 2025-12-16 19:24:39 +00:00
Move include files to folder.
This commit is contained in:
@@ -11,7 +11,7 @@ AllowAllParametersOfDeclarationOnNextLine: false
|
|||||||
AllowShortBlocksOnASingleLine: true
|
AllowShortBlocksOnASingleLine: true
|
||||||
AllowShortCaseLabelsOnASingleLine: true
|
AllowShortCaseLabelsOnASingleLine: true
|
||||||
AllowShortFunctionsOnASingleLine: All
|
AllowShortFunctionsOnASingleLine: All
|
||||||
AllowShortIfStatementsOnASingleLine: true
|
AllowShortIfStatementsOnASingleLine: Always
|
||||||
AllowShortLoopsOnASingleLine: true
|
AllowShortLoopsOnASingleLine: true
|
||||||
AlwaysBreakAfterDefinitionReturnType: None
|
AlwaysBreakAfterDefinitionReturnType: None
|
||||||
AlwaysBreakAfterReturnType: None
|
AlwaysBreakAfterReturnType: None
|
||||||
@@ -58,14 +58,21 @@ ForEachMacros:
|
|||||||
- BOOST_FOREACH
|
- BOOST_FOREACH
|
||||||
IncludeBlocks: Regroup
|
IncludeBlocks: Regroup
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '<[[:alnum:].]+>'
|
- Regex: '^(<winsock2.h>)'
|
||||||
Priority: -1
|
Priority: -3
|
||||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
SortPriority: -4
|
||||||
Priority: 2
|
- Regex: '^(<windows.h>)'
|
||||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
Priority: -3
|
||||||
Priority: 3
|
SortPriority: -3
|
||||||
|
- Regex: '^(<.*)'
|
||||||
|
Priority: -2
|
||||||
|
SortPriority: -2
|
||||||
|
- Regex: '^("(win32|windows))'
|
||||||
|
Priority: 1
|
||||||
|
SortPriority: -1
|
||||||
- Regex: '.*'
|
- Regex: '.*'
|
||||||
Priority: 1
|
Priority: 1
|
||||||
|
SortPriority: 1
|
||||||
IncludeIsMainRegex: '(Test)?$'
|
IncludeIsMainRegex: '(Test)?$'
|
||||||
IndentCaseLabels: true
|
IndentCaseLabels: true
|
||||||
IndentPPDirectives: None
|
IndentPPDirectives: None
|
||||||
@@ -88,7 +95,7 @@ PenaltyBreakFirstLessLess: 120
|
|||||||
PenaltyBreakString: 1000
|
PenaltyBreakString: 1000
|
||||||
PenaltyExcessCharacter: 1000000
|
PenaltyExcessCharacter: 1000000
|
||||||
PenaltyReturnTypeOnItsOwnLine: 60
|
PenaltyReturnTypeOnItsOwnLine: 60
|
||||||
PointerAlignment: Right
|
PointerAlignment: Left
|
||||||
ReflowComments: true
|
ReflowComments: true
|
||||||
SortIncludes: true
|
SortIncludes: true
|
||||||
SortUsingDeclarations: true
|
SortUsingDeclarations: true
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ project(setter C)
|
|||||||
|
|
||||||
set(CMAKE_C_STANDARD 90)
|
set(CMAKE_C_STANDARD 90)
|
||||||
|
|
||||||
add_executable(setter src/consts.h src/defs.h src/main.h src/dosos2.h src/os2_16.h src/os2_32.h src/main.c src/dos.c src/os2_16.c src/os2_32.c src/win32.c src/win32.h src/unix/unix.c src/macos.c src/macos.h src/unix/unix.h src/linux/linux.c src/linux/linux.h src/netware.c src/netware.h)
|
add_executable(setter src/include/consts.h src/include/defs.h src/main.h src/dosos2.h src/os2_16.h src/os2_32.h src/main.c src/dos.c src/os2_16.c src/os2_32.c src/win32.c src/win32.h src/unix/unix.c src/macos.c src/macos.h src/unix/unix.h src/linux/linux.c src/linux/linux.h src/netware.c src/netware.h)
|
||||||
100
setter/src/dos.c
100
setter/src/dos.c
@@ -42,9 +42,9 @@ Copyright (C) 2011-2021 Natalia Portillo
|
|||||||
|
|
||||||
#include "dos.h"
|
#include "dos.h"
|
||||||
|
|
||||||
#include "consts.h"
|
|
||||||
#include "defs.h"
|
|
||||||
#include "dosos2.h"
|
#include "dosos2.h"
|
||||||
|
#include "include/consts.h"
|
||||||
|
#include "include/defs.h"
|
||||||
|
|
||||||
void GetOsInfo()
|
void GetOsInfo()
|
||||||
{
|
{
|
||||||
@@ -87,14 +87,14 @@ void GetOsInfo()
|
|||||||
printf("\tRunning under DOS %d.%d\n", major, minor);
|
printf("\tRunning under DOS %d.%d\n", major, minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetVolumeInfo(const char *path, size_t *clusterSize)
|
void GetVolumeInfo(const char* path, size_t* clusterSize)
|
||||||
{
|
{
|
||||||
union REGS regs;
|
union REGS regs;
|
||||||
struct SREGS sregs;
|
struct SREGS sregs;
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
char driveNo = path[0] - '@';
|
char driveNo = path[0] - '@';
|
||||||
struct diskfree_t oldFreeSpace;
|
struct diskfree_t oldFreeSpace;
|
||||||
Fat32FreeSpace * freeSpace = malloc(sizeof(Fat32FreeSpace));
|
Fat32FreeSpace* freeSpace = malloc(sizeof(Fat32FreeSpace));
|
||||||
|
|
||||||
memset(freeSpace, 0, sizeof(Fat32FreeSpace));
|
memset(freeSpace, 0, sizeof(Fat32FreeSpace));
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ void GetVolumeInfo(const char *path, size_t *clusterSize)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileAttributes(const char *path)
|
void FileAttributes(const char* path)
|
||||||
{
|
{
|
||||||
char driveNo = path[0] - '@';
|
char driveNo = path[0] - '@';
|
||||||
unsigned total, actionTaken;
|
unsigned total, actionTaken;
|
||||||
@@ -173,7 +173,7 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)noAttributeText, strlen(noAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)noAttributeText, strlen(noAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("NONE", _A_NORMAL);
|
rc = _dos_setfileattr("NONE", _A_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -184,7 +184,7 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("ARCHIVE", _A_ARCH);
|
rc = _dos_setfileattr("ARCHIVE", _A_ARCH);
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("SYSTEM", _A_SYSTEM);
|
rc = _dos_setfileattr("SYSTEM", _A_SYSTEM);
|
||||||
}
|
}
|
||||||
@@ -206,7 +206,7 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("HIDDEN", _A_HIDDEN);
|
rc = _dos_setfileattr("HIDDEN", _A_HIDDEN);
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("READONLY", _A_RDONLY);
|
rc = _dos_setfileattr("READONLY", _A_RDONLY);
|
||||||
}
|
}
|
||||||
@@ -228,8 +228,8 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("HIDDREAD", _A_HIDDEN | _A_RDONLY);
|
rc = _dos_setfileattr("HIDDREAD", _A_HIDDEN | _A_RDONLY);
|
||||||
}
|
}
|
||||||
@@ -244,8 +244,8 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("SYSTREAD", _A_SYSTEM | _A_RDONLY);
|
rc = _dos_setfileattr("SYSTREAD", _A_SYSTEM | _A_RDONLY);
|
||||||
}
|
}
|
||||||
@@ -260,8 +260,8 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("SYSTHIDD", _A_SYSTEM | _A_HIDDEN);
|
rc = _dos_setfileattr("SYSTHIDD", _A_SYSTEM | _A_HIDDEN);
|
||||||
}
|
}
|
||||||
@@ -276,9 +276,9 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("SYSRDYHD", _A_SYSTEM | _A_RDONLY | _A_HIDDEN);
|
rc = _dos_setfileattr("SYSRDYHD", _A_SYSTEM | _A_RDONLY | _A_HIDDEN);
|
||||||
}
|
}
|
||||||
@@ -293,8 +293,8 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("ARCHREAD", _A_ARCH | _A_RDONLY);
|
rc = _dos_setfileattr("ARCHREAD", _A_ARCH | _A_RDONLY);
|
||||||
}
|
}
|
||||||
@@ -309,8 +309,8 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("ARCHHIDD", _A_ARCH | _A_HIDDEN);
|
rc = _dos_setfileattr("ARCHHIDD", _A_ARCH | _A_HIDDEN);
|
||||||
}
|
}
|
||||||
@@ -325,9 +325,9 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("ARCHDRDY", _A_ARCH | _A_HIDDEN | _A_RDONLY);
|
rc = _dos_setfileattr("ARCHDRDY", _A_ARCH | _A_HIDDEN | _A_RDONLY);
|
||||||
}
|
}
|
||||||
@@ -342,8 +342,8 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("ARCHSYST", _A_ARCH | _A_SYSTEM);
|
rc = _dos_setfileattr("ARCHSYST", _A_ARCH | _A_SYSTEM);
|
||||||
}
|
}
|
||||||
@@ -358,9 +358,9 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("ARSYSRDY", _A_ARCH | _A_SYSTEM | _A_RDONLY);
|
rc = _dos_setfileattr("ARSYSRDY", _A_ARCH | _A_SYSTEM | _A_RDONLY);
|
||||||
}
|
}
|
||||||
@@ -375,9 +375,9 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("ARCSYSHD", _A_ARCH | _A_SYSTEM | _A_HIDDEN);
|
rc = _dos_setfileattr("ARCSYSHD", _A_ARCH | _A_SYSTEM | _A_HIDDEN);
|
||||||
}
|
}
|
||||||
@@ -392,10 +392,10 @@ void FileAttributes(const char *path)
|
|||||||
|
|
||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
wRc = _dos_write(handle, (void *)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)archivedAttributeText, strlen(archivedAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)systemAttributeText, strlen(systemAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)hiddenAttributeText, strlen(hiddenAttributeText), &actionTaken);
|
||||||
wRc = _dos_write(handle, (void *)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
wRc = _dos_write(handle, (void*)readonlyAttributeText, strlen(readonlyAttributeText), &actionTaken);
|
||||||
cRc = _dos_close(handle);
|
cRc = _dos_close(handle);
|
||||||
rc = _dos_setfileattr("ARSYHDRD", _A_ARCH | _A_SYSTEM | _A_HIDDEN | _A_RDONLY);
|
rc = _dos_setfileattr("ARSYHDRD", _A_ARCH | _A_SYSTEM | _A_HIDDEN | _A_RDONLY);
|
||||||
}
|
}
|
||||||
@@ -408,19 +408,19 @@ void FileAttributes(const char *path)
|
|||||||
cRc);
|
cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilePermissions(const char *path)
|
void FilePermissions(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtendedAttributes(const char *path)
|
void ExtendedAttributes(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceFork(const char *path)
|
void ResourceFork(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filenames(const char *path)
|
void Filenames(const char* path)
|
||||||
{
|
{
|
||||||
char driveNo = path[0] - '@';
|
char driveNo = path[0] - '@';
|
||||||
int rc = 0, wRc = 0, cRc = 0;
|
int rc = 0, wRc = 0, cRc = 0;
|
||||||
@@ -464,7 +464,7 @@ void Filenames(const char *path)
|
|||||||
|
|
||||||
#define DATETIME_FORMAT "This file is dated %04d/%02d/%02d %02d:%02d:%02d for %s\n"
|
#define DATETIME_FORMAT "This file is dated %04d/%02d/%02d %02d:%02d:%02d for %s\n"
|
||||||
|
|
||||||
void Timestamps(const char *path)
|
void Timestamps(const char* path)
|
||||||
{
|
{
|
||||||
char driveNo = path[0] - '@';
|
char driveNo = path[0] - '@';
|
||||||
int rc = 0, wRc = 0, cRc = 0, tRc = 0;
|
int rc = 0, wRc = 0, cRc = 0, tRc = 0;
|
||||||
@@ -832,7 +832,7 @@ void Timestamps(const char *path)
|
|||||||
printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2KATIME", rc, wRc, cRc, tRc);
|
printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2KATIME", rc, wRc, cRc, tRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirectoryDepth(const char *path)
|
void DirectoryDepth(const char* path)
|
||||||
{
|
{
|
||||||
char driveNo = path[0] - '@';
|
char driveNo = path[0] - '@';
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
@@ -871,14 +871,14 @@ void DirectoryDepth(const char *path)
|
|||||||
printf("\tCreated %d levels of directory hierarchy\n", pos);
|
printf("\tCreated %d levels of directory hierarchy\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fragmentation(const char *path, size_t clusterSize)
|
void Fragmentation(const char* path, size_t clusterSize)
|
||||||
{
|
{
|
||||||
size_t halfCluster = clusterSize / 2;
|
size_t halfCluster = clusterSize / 2;
|
||||||
size_t quarterCluster = clusterSize / 4;
|
size_t quarterCluster = clusterSize / 4;
|
||||||
size_t twoCluster = clusterSize * 2;
|
size_t twoCluster = clusterSize * 2;
|
||||||
size_t threeQuartersCluster = halfCluster + quarterCluster;
|
size_t threeQuartersCluster = halfCluster + quarterCluster;
|
||||||
size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
|
size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
|
||||||
unsigned char *buffer;
|
unsigned char* buffer;
|
||||||
char driveNo = path[0] - '@';
|
char driveNo = path[0] - '@';
|
||||||
int rc = 0, wRc = 0, cRc = 0;
|
int rc = 0, wRc = 0, cRc = 0;
|
||||||
unsigned total, actionTaken = 0;
|
unsigned total, actionTaken = 0;
|
||||||
@@ -1079,15 +1079,15 @@ void Fragmentation(const char *path, size_t clusterSize)
|
|||||||
cRc);
|
cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sparse(const char *path)
|
void Sparse(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Links(const char *path)
|
void Links(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MillionFiles(const char *path)
|
void MillionFiles(const char* path)
|
||||||
{
|
{
|
||||||
char driveNo = path[0] - '@';
|
char driveNo = path[0] - '@';
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
@@ -1126,7 +1126,7 @@ void MillionFiles(const char *path)
|
|||||||
printf("\tCreated %llu files\n", pos);
|
printf("\tCreated %llu files\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteFiles(const char *path)
|
void DeleteFiles(const char* path)
|
||||||
{
|
{
|
||||||
char driveNo = path[0] - '@';
|
char driveNo = path[0] - '@';
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Copyright (C) 2011-2021 Natalia Portillo
|
|||||||
|
|
||||||
#if defined(__linux__) || defined(__LINUX__) || defined(__gnu_linux)
|
#if defined(__linux__) || defined(__LINUX__) || defined(__gnu_linux)
|
||||||
|
|
||||||
#include "../consts.h"
|
#include "../include/consts.h"
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|||||||
@@ -31,11 +31,6 @@ Copyright (C) 2011-2021 Natalia Portillo
|
|||||||
|
|
||||||
#if defined(macintosh)
|
#if defined(macintosh)
|
||||||
|
|
||||||
#include "macos.h"
|
|
||||||
|
|
||||||
#include "consts.h"
|
|
||||||
#include "defs.h"
|
|
||||||
|
|
||||||
#include <Aliases.h>
|
#include <Aliases.h>
|
||||||
#include <FileTypesAndCreators.h>
|
#include <FileTypesAndCreators.h>
|
||||||
#include <Files.h>
|
#include <Files.h>
|
||||||
@@ -48,6 +43,11 @@ Copyright (C) 2011-2021 Natalia Portillo
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "macos.h"
|
||||||
|
|
||||||
|
#include "include/consts.h"
|
||||||
|
#include "include/defs.h"
|
||||||
|
|
||||||
void GetOsInfo()
|
void GetOsInfo()
|
||||||
{
|
{
|
||||||
int32_t gestaltResponse;
|
int32_t gestaltResponse;
|
||||||
@@ -86,7 +86,7 @@ void GetOsInfo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetVolumeInfo(const char *path, size_t *clusterSize)
|
void GetVolumeInfo(const char* path, size_t* clusterSize)
|
||||||
{
|
{
|
||||||
OSErr rc;
|
OSErr rc;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
@@ -107,7 +107,7 @@ void GetVolumeInfo(const char *path, size_t *clusterSize)
|
|||||||
int bigVol = 0;
|
int bigVol = 0;
|
||||||
*clusterSize = 0;
|
*clusterSize = 0;
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
|
|
||||||
rc = Gestalt(gestaltFSAttr, &gestaltResponse);
|
rc = Gestalt(gestaltFSAttr, &gestaltResponse);
|
||||||
if(!rc)
|
if(!rc)
|
||||||
@@ -194,7 +194,7 @@ void GetVolumeInfo(const char *path, size_t *clusterSize)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileAttributes(const char *path)
|
void FileAttributes(const char* path)
|
||||||
{
|
{
|
||||||
OSErr rc, wRc, cRc;
|
OSErr rc, wRc, cRc;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
@@ -204,10 +204,10 @@ void FileAttributes(const char *path)
|
|||||||
int32_t dirId;
|
int32_t dirId;
|
||||||
FInfo finderInfo;
|
FInfo finderInfo;
|
||||||
int32_t count;
|
int32_t count;
|
||||||
HFileInfo * fpb;
|
HFileInfo* fpb;
|
||||||
CInfoPBRec cipbr;
|
CInfoPBRec cipbr;
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -219,7 +219,7 @@ void FileAttributes(const char *path)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pATTRS", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pATTRS", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -836,9 +836,13 @@ void FileAttributes(const char *path)
|
|||||||
printf("\tFile has all flags bits set: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "ALL", rc, wRc, cRc);
|
printf("\tFile has all flags bits set: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "ALL", rc, wRc, cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilePermissions(const char *path) { /* Do nothing, not supported by target operating system */ }
|
void FilePermissions(const char* path)
|
||||||
|
{ /* Do nothing, not supported by target operating system */
|
||||||
|
}
|
||||||
|
|
||||||
void ExtendedAttributes(const char *path) { /* Do nothing, not supported by target operating system */ }
|
void ExtendedAttributes(const char* path)
|
||||||
|
{ /* Do nothing, not supported by target operating system */
|
||||||
|
}
|
||||||
|
|
||||||
static OSErr SaveResourceToNewFile(int16_t vRefNum,
|
static OSErr SaveResourceToNewFile(int16_t vRefNum,
|
||||||
int32_t dirID,
|
int32_t dirID,
|
||||||
@@ -846,7 +850,7 @@ static OSErr SaveResourceToNewFile(int16_t vRefNum,
|
|||||||
ResType type,
|
ResType type,
|
||||||
int16_t resId,
|
int16_t resId,
|
||||||
Str255 resName,
|
Str255 resName,
|
||||||
unsigned char *buffer,
|
unsigned char* buffer,
|
||||||
size_t length)
|
size_t length)
|
||||||
{
|
{
|
||||||
Handle h;
|
Handle h;
|
||||||
@@ -878,7 +882,7 @@ static OSErr SaveResourceToNewFile(int16_t vRefNum,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceFork(const char *path)
|
void ResourceFork(const char* path)
|
||||||
{
|
{
|
||||||
OSErr rc, wRc, cRc, rRc, rRc2, rRc3;
|
OSErr rc, wRc, cRc, rRc, rRc2, rRc3;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
@@ -888,10 +892,10 @@ void ResourceFork(const char *path)
|
|||||||
int32_t dirId;
|
int32_t dirId;
|
||||||
FInfo finderInfo;
|
FInfo finderInfo;
|
||||||
int32_t count;
|
int32_t count;
|
||||||
HFileInfo * fpb;
|
HFileInfo* fpb;
|
||||||
CInfoPBRec cipbr;
|
CInfoPBRec cipbr;
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -903,7 +907,7 @@ void ResourceFork(const char *path)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pRSRC", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pRSRC", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -922,7 +926,7 @@ void ResourceFork(const char *path)
|
|||||||
rtIcons,
|
rtIcons,
|
||||||
-16455,
|
-16455,
|
||||||
"\pIcon resource",
|
"\pIcon resource",
|
||||||
(unsigned char *)IcnsResource,
|
(unsigned char*)IcnsResource,
|
||||||
sizeof(IcnsResource));
|
sizeof(IcnsResource));
|
||||||
rc = HOpenDF(refNum, dirId, "\pICON", 0, &refFile);
|
rc = HOpenDF(refNum, dirId, "\pICON", 0, &refFile);
|
||||||
if(!rc)
|
if(!rc)
|
||||||
@@ -953,7 +957,7 @@ void ResourceFork(const char *path)
|
|||||||
ftPICTFile,
|
ftPICTFile,
|
||||||
29876,
|
29876,
|
||||||
"\pPicture resource",
|
"\pPicture resource",
|
||||||
(unsigned char *)PictResource,
|
(unsigned char*)PictResource,
|
||||||
sizeof(PictResource));
|
sizeof(PictResource));
|
||||||
rc = HOpenDF(refNum, dirId, "\pPICT", 0, &refFile);
|
rc = HOpenDF(refNum, dirId, "\pPICT", 0, &refFile);
|
||||||
if(!rc)
|
if(!rc)
|
||||||
@@ -983,7 +987,7 @@ void ResourceFork(const char *path)
|
|||||||
rtVersion,
|
rtVersion,
|
||||||
1,
|
1,
|
||||||
"\pVersion resource",
|
"\pVersion resource",
|
||||||
(unsigned char *)VersResource,
|
(unsigned char*)VersResource,
|
||||||
sizeof(VersResource));
|
sizeof(VersResource));
|
||||||
rc = HOpenDF(refNum, dirId, "\pVERSION", 0, &refFile);
|
rc = HOpenDF(refNum, dirId, "\pVERSION", 0, &refFile);
|
||||||
if(!rc)
|
if(!rc)
|
||||||
@@ -1013,7 +1017,7 @@ void ResourceFork(const char *path)
|
|||||||
rtIcons,
|
rtIcons,
|
||||||
-16455,
|
-16455,
|
||||||
"\pIcon resource",
|
"\pIcon resource",
|
||||||
(unsigned char *)IcnsResource,
|
(unsigned char*)IcnsResource,
|
||||||
sizeof(IcnsResource));
|
sizeof(IcnsResource));
|
||||||
rRc2 = SaveResourceToNewFile(refNum,
|
rRc2 = SaveResourceToNewFile(refNum,
|
||||||
dirId,
|
dirId,
|
||||||
@@ -1021,7 +1025,7 @@ void ResourceFork(const char *path)
|
|||||||
ftPICTFile,
|
ftPICTFile,
|
||||||
29876,
|
29876,
|
||||||
"\pPicture resource",
|
"\pPicture resource",
|
||||||
(unsigned char *)PictResource,
|
(unsigned char*)PictResource,
|
||||||
sizeof(PictResource));
|
sizeof(PictResource));
|
||||||
rRc3 = SaveResourceToNewFile(refNum,
|
rRc3 = SaveResourceToNewFile(refNum,
|
||||||
dirId,
|
dirId,
|
||||||
@@ -1029,7 +1033,7 @@ void ResourceFork(const char *path)
|
|||||||
rtVersion,
|
rtVersion,
|
||||||
1,
|
1,
|
||||||
"\pVersion resource",
|
"\pVersion resource",
|
||||||
(unsigned char *)VersResource,
|
(unsigned char*)VersResource,
|
||||||
sizeof(VersResource));
|
sizeof(VersResource));
|
||||||
rc = HOpenDF(refNum, dirId, "\pALL", 0, &refFile);
|
rc = HOpenDF(refNum, dirId, "\pALL", 0, &refFile);
|
||||||
if(!rc)
|
if(!rc)
|
||||||
@@ -1054,7 +1058,7 @@ void ResourceFork(const char *path)
|
|||||||
rRc3);
|
rRc3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filenames(const char *path)
|
void Filenames(const char* path)
|
||||||
{
|
{
|
||||||
OSErr rc, wRc, cRc;
|
OSErr rc, wRc, cRc;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
@@ -1067,7 +1071,7 @@ void Filenames(const char *path)
|
|||||||
char message[300];
|
char message[300];
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -1079,7 +1083,7 @@ void Filenames(const char *path)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pFILENAME", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pFILENAME", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -1103,7 +1107,7 @@ void Filenames(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, FILENAME_FORMAT, filenames[pos]);
|
sprintf((char*)message, FILENAME_FORMAT, filenames[pos]);
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
@@ -1114,7 +1118,7 @@ void Filenames(const char *path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timestamps(const char *path)
|
void Timestamps(const char* path)
|
||||||
{
|
{
|
||||||
OSErr rc, wRc, cRc, tRc;
|
OSErr rc, wRc, cRc, tRc;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
@@ -1124,11 +1128,11 @@ void Timestamps(const char *path)
|
|||||||
int32_t dirId;
|
int32_t dirId;
|
||||||
FInfo finderInfo;
|
FInfo finderInfo;
|
||||||
int32_t count;
|
int32_t count;
|
||||||
HFileInfo * fpb;
|
HFileInfo* fpb;
|
||||||
CInfoPBRec cipbr;
|
CInfoPBRec cipbr;
|
||||||
char message[300];
|
char message[300];
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -1140,7 +1144,7 @@ void Timestamps(const char *path)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pTIMES", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pTIMES", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -1156,13 +1160,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, MAXDATETIME, "creation");
|
sprintf((char*)message, DATETIME_FORMAT, MAXDATETIME, "creation");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pMAXCTIME";
|
fpb->ioNamePtr = "\pMAXCTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1184,13 +1188,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, MAXDATETIME, "modification");
|
sprintf((char*)message, DATETIME_FORMAT, MAXDATETIME, "modification");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pMAXMTIME";
|
fpb->ioNamePtr = "\pMAXMTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1212,13 +1216,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, MAXDATETIME, "backup");
|
sprintf((char*)message, DATETIME_FORMAT, MAXDATETIME, "backup");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pMAXBTIME";
|
fpb->ioNamePtr = "\pMAXBTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1240,13 +1244,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, MINDATETIME, "creation");
|
sprintf((char*)message, DATETIME_FORMAT, MINDATETIME, "creation");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pMINCTIME";
|
fpb->ioNamePtr = "\pMINCTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1268,13 +1272,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, MINDATETIME, "modification");
|
sprintf((char*)message, DATETIME_FORMAT, MINDATETIME, "modification");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pMINMTIME";
|
fpb->ioNamePtr = "\pMINMTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1296,13 +1300,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, MINDATETIME, "backup");
|
sprintf((char*)message, DATETIME_FORMAT, MINDATETIME, "backup");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pMINBTIME";
|
fpb->ioNamePtr = "\pMINBTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1324,13 +1328,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, Y2KDATETIME, "creation");
|
sprintf((char*)message, DATETIME_FORMAT, Y2KDATETIME, "creation");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pY2KCTIME";
|
fpb->ioNamePtr = "\pY2KCTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1352,13 +1356,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, Y2KDATETIME, "modification");
|
sprintf((char*)message, DATETIME_FORMAT, Y2KDATETIME, "modification");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pY2KMTIME";
|
fpb->ioNamePtr = "\pY2KMTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1380,13 +1384,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, Y2KDATETIME, "backup");
|
sprintf((char*)message, DATETIME_FORMAT, Y2KDATETIME, "backup");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pY2KBTIME";
|
fpb->ioNamePtr = "\pY2KBTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1408,13 +1412,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, Y1KDATETIME, "creation");
|
sprintf((char*)message, DATETIME_FORMAT, Y1KDATETIME, "creation");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pY1KCTIME";
|
fpb->ioNamePtr = "\pY1KCTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1436,13 +1440,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, Y1KDATETIME, "modification");
|
sprintf((char*)message, DATETIME_FORMAT, Y1KDATETIME, "modification");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pY1KMTIME";
|
fpb->ioNamePtr = "\pY1KMTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1464,13 +1468,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, Y1KDATETIME, "backup");
|
sprintf((char*)message, DATETIME_FORMAT, Y1KDATETIME, "backup");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pY1KBTIME";
|
fpb->ioNamePtr = "\pY1KBTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1492,13 +1496,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, MAXDATETIME, "all");
|
sprintf((char*)message, DATETIME_FORMAT, MAXDATETIME, "all");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pMAXTIME";
|
fpb->ioNamePtr = "\pMAXTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1520,13 +1524,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, MINDATETIME, "all");
|
sprintf((char*)message, DATETIME_FORMAT, MINDATETIME, "all");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pMINTIME";
|
fpb->ioNamePtr = "\pMINTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1548,13 +1552,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, NONDATETIME, "all");
|
sprintf((char*)message, DATETIME_FORMAT, NONDATETIME, "all");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pNOTIME";
|
fpb->ioNamePtr = "\pNOTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1576,13 +1580,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, Y2KDATETIME, "all");
|
sprintf((char*)message, DATETIME_FORMAT, Y2KDATETIME, "all");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pY2KTIME";
|
fpb->ioNamePtr = "\pY2KTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1604,13 +1608,13 @@ void Timestamps(const char *path)
|
|||||||
if(!rc)
|
if(!rc)
|
||||||
{
|
{
|
||||||
memset(&message, 0, 300);
|
memset(&message, 0, 300);
|
||||||
sprintf((char *)message, DATETIME_FORMAT, Y1KDATETIME, "all");
|
sprintf((char*)message, DATETIME_FORMAT, Y1KDATETIME, "all");
|
||||||
count = strlen(message);
|
count = strlen(message);
|
||||||
wRc = FSWrite(refFile, &count, message);
|
wRc = FSWrite(refFile, &count, message);
|
||||||
cRc = FSClose(refFile);
|
cRc = FSClose(refFile);
|
||||||
}
|
}
|
||||||
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
memset(&cipbr, 0, sizeof(CInfoPBRec));
|
||||||
fpb = (HFileInfo *)&cipbr;
|
fpb = (HFileInfo*)&cipbr;
|
||||||
fpb->ioVRefNum = refNum;
|
fpb->ioVRefNum = refNum;
|
||||||
fpb->ioNamePtr = "\pY1KTIME";
|
fpb->ioNamePtr = "\pY1KTIME";
|
||||||
fpb->ioDirID = dirId;
|
fpb->ioDirID = dirId;
|
||||||
@@ -1626,7 +1630,7 @@ void Timestamps(const char *path)
|
|||||||
printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y1KTIME", rc, wRc, cRc, tRc);
|
printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y1KTIME", rc, wRc, cRc, tRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirectoryDepth(const char *path)
|
void DirectoryDepth(const char* path)
|
||||||
{
|
{
|
||||||
OSErr rc, wRc, cRc;
|
OSErr rc, wRc, cRc;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
@@ -1639,7 +1643,7 @@ void DirectoryDepth(const char *path)
|
|||||||
char filename[9];
|
char filename[9];
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -1651,7 +1655,7 @@ void DirectoryDepth(const char *path)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pDEPTH", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pDEPTH", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -1663,7 +1667,7 @@ void DirectoryDepth(const char *path)
|
|||||||
while(!rc)
|
while(!rc)
|
||||||
{
|
{
|
||||||
memset(&filename, 0, 9);
|
memset(&filename, 0, 9);
|
||||||
sprintf((char *)filename, "%08d", pos);
|
sprintf((char*)filename, "%08d", pos);
|
||||||
str255[0] = 8;
|
str255[0] = 8;
|
||||||
memcpy(str255 + 1, filename, 8);
|
memcpy(str255 + 1, filename, 8);
|
||||||
|
|
||||||
@@ -1677,14 +1681,14 @@ void DirectoryDepth(const char *path)
|
|||||||
printf("\tCreated %d levels of directory hierarchy\n", pos);
|
printf("\tCreated %d levels of directory hierarchy\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fragmentation(const char *path, size_t clusterSize)
|
void Fragmentation(const char* path, size_t clusterSize)
|
||||||
{
|
{
|
||||||
size_t halfCluster = clusterSize / 2;
|
size_t halfCluster = clusterSize / 2;
|
||||||
size_t quarterCluster = clusterSize / 4;
|
size_t quarterCluster = clusterSize / 4;
|
||||||
size_t twoCluster = clusterSize * 2;
|
size_t twoCluster = clusterSize * 2;
|
||||||
size_t threeQuartersCluster = halfCluster + quarterCluster;
|
size_t threeQuartersCluster = halfCluster + quarterCluster;
|
||||||
size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
|
size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
|
||||||
unsigned char *buffer;
|
unsigned char* buffer;
|
||||||
OSErr rc, wRc, cRc;
|
OSErr rc, wRc, cRc;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
HVolumeParam hpb;
|
HVolumeParam hpb;
|
||||||
@@ -1694,7 +1698,7 @@ void Fragmentation(const char *path, size_t clusterSize)
|
|||||||
int32_t count;
|
int32_t count;
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -1706,7 +1710,7 @@ void Fragmentation(const char *path, size_t clusterSize)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pFRAGS", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pFRAGS", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -1935,11 +1939,13 @@ void Fragmentation(const char *path, size_t clusterSize)
|
|||||||
cRc);
|
cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sparse(const char *path) { /* Do nothing, not supported by target operating system */ }
|
void Sparse(const char* path)
|
||||||
|
{ /* Do nothing, not supported by target operating system */
|
||||||
|
}
|
||||||
|
|
||||||
static pascal OSErr
|
static pascal OSErr
|
||||||
|
|
||||||
CreateAliasFile(const FSSpec *targetFile, const FSSpec *aliasFile, OSType fileCreator, OSType fileType)
|
CreateAliasFile(const FSSpec* targetFile, const FSSpec* aliasFile, OSType fileCreator, OSType fileType)
|
||||||
{
|
{
|
||||||
short rsrcID;
|
short rsrcID;
|
||||||
short aliasRefnum;
|
short aliasRefnum;
|
||||||
@@ -1972,7 +1978,7 @@ static pascal OSErr
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Links(const char *path)
|
void Links(const char* path)
|
||||||
{
|
{
|
||||||
int32_t gestaltResponse;
|
int32_t gestaltResponse;
|
||||||
OSErr rc, wRc, cRc, oRc, aRc;
|
OSErr rc, wRc, cRc, oRc, aRc;
|
||||||
@@ -1993,7 +1999,7 @@ void Links(const char *path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -2005,7 +2011,7 @@ void Links(const char *path)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pLINKS", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pLINKS", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -2017,7 +2023,7 @@ void Links(const char *path)
|
|||||||
for(pos = 0; pos < 64; pos++)
|
for(pos = 0; pos < 64; pos++)
|
||||||
{
|
{
|
||||||
memset(&filename, 0, 9);
|
memset(&filename, 0, 9);
|
||||||
sprintf((char *)filename, "TARGET%02d", pos);
|
sprintf((char*)filename, "TARGET%02d", pos);
|
||||||
str255[0] = 8;
|
str255[0] = 8;
|
||||||
memcpy(str255 + 1, filename, 8);
|
memcpy(str255 + 1, filename, 8);
|
||||||
|
|
||||||
@@ -2039,7 +2045,7 @@ void Links(const char *path)
|
|||||||
memcpy(targetSpec.name + 1, filename, 8);
|
memcpy(targetSpec.name + 1, filename, 8);
|
||||||
|
|
||||||
memset(&filename, 0, 9);
|
memset(&filename, 0, 9);
|
||||||
sprintf((char *)filename, "ALIAS_%02d", pos);
|
sprintf((char*)filename, "ALIAS_%02d", pos);
|
||||||
memset(&aliasSpec, 0, sizeof(FSSpec));
|
memset(&aliasSpec, 0, sizeof(FSSpec));
|
||||||
aliasSpec.vRefNum = refNum;
|
aliasSpec.vRefNum = refNum;
|
||||||
aliasSpec.parID = dirId;
|
aliasSpec.parID = dirId;
|
||||||
@@ -2054,7 +2060,7 @@ void Links(const char *path)
|
|||||||
printf("pos = %d, rc = %d, wRc = %d, cRc = %d, oRc = %d, aRc = %d\n", pos, rc, wRc, cRc, oRc, aRc);
|
printf("pos = %d, rc = %d, wRc = %d, cRc = %d, oRc = %d, aRc = %d\n", pos, rc, wRc, cRc, oRc, aRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MillionFiles(const char *path)
|
void MillionFiles(const char* path)
|
||||||
{
|
{
|
||||||
OSErr rc, wRc, cRc;
|
OSErr rc, wRc, cRc;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
@@ -2067,7 +2073,7 @@ void MillionFiles(const char *path)
|
|||||||
char filename[9];
|
char filename[9];
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -2079,7 +2085,7 @@ void MillionFiles(const char *path)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pMILLION", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pMILLION", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -2091,7 +2097,7 @@ void MillionFiles(const char *path)
|
|||||||
for(pos = 0; pos < 5000; pos++)
|
for(pos = 0; pos < 5000; pos++)
|
||||||
{
|
{
|
||||||
memset(&filename, 0, 9);
|
memset(&filename, 0, 9);
|
||||||
sprintf((char *)filename, "%08d", pos);
|
sprintf((char*)filename, "%08d", pos);
|
||||||
str255[0] = 8;
|
str255[0] = 8;
|
||||||
memcpy(str255 + 1, filename, 8);
|
memcpy(str255 + 1, filename, 8);
|
||||||
|
|
||||||
@@ -2103,7 +2109,7 @@ void MillionFiles(const char *path)
|
|||||||
printf("\tCreated %d files\n", pos);
|
printf("\tCreated %d files\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteFiles(const char *path)
|
void DeleteFiles(const char* path)
|
||||||
{
|
{
|
||||||
OSErr rc, wRc, cRc;
|
OSErr rc, wRc, cRc;
|
||||||
Str255 str255;
|
Str255 str255;
|
||||||
@@ -2116,7 +2122,7 @@ void DeleteFiles(const char *path)
|
|||||||
char filename[9];
|
char filename[9];
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
|
||||||
snprintf((char *)str255, 255, "%s", path);
|
snprintf((char*)str255, 255, "%s", path);
|
||||||
hpb.ioNamePtr = str255;
|
hpb.ioNamePtr = str255;
|
||||||
hpb.ioVRefNum = 0;
|
hpb.ioVRefNum = 0;
|
||||||
hpb.ioVolIndex = -1;
|
hpb.ioVolIndex = -1;
|
||||||
@@ -2128,7 +2134,7 @@ void DeleteFiles(const char *path)
|
|||||||
}
|
}
|
||||||
refNum = hpb.ioVRefNum;
|
refNum = hpb.ioVRefNum;
|
||||||
|
|
||||||
rc = DirCreate(refNum, fsRtDirID, (unsigned char *)"\pDELETED", &dirId);
|
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pDELETED", &dirId);
|
||||||
if(rc)
|
if(rc)
|
||||||
{
|
{
|
||||||
printf("Error %d creating working directory.\n", rc);
|
printf("Error %d creating working directory.\n", rc);
|
||||||
@@ -2140,7 +2146,7 @@ void DeleteFiles(const char *path)
|
|||||||
for(pos = 0; pos < 64; pos++)
|
for(pos = 0; pos < 64; pos++)
|
||||||
{
|
{
|
||||||
memset(&filename, 0, 9);
|
memset(&filename, 0, 9);
|
||||||
sprintf((char *)filename, "%08d", pos);
|
sprintf((char*)filename, "%08d", pos);
|
||||||
str255[0] = 8;
|
str255[0] = 8;
|
||||||
memcpy(str255 + 1, filename, 8);
|
memcpy(str255 + 1, filename, 8);
|
||||||
|
|
||||||
|
|||||||
@@ -29,18 +29,19 @@ Contains global definitions
|
|||||||
Copyright (C) 2011-2021 Natalia Portillo
|
Copyright (C) 2011-2021 Natalia Portillo
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
#include "defs.h"
|
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
#include "include/defs.h"
|
||||||
|
|
||||||
#if defined(macintosh)
|
#if defined(macintosh)
|
||||||
#include <SIOUX.h>
|
#include <SIOUX.h>
|
||||||
#include <console.h>
|
#include <console.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
size_t clusterSize = 0;
|
size_t clusterSize = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -33,76 +33,76 @@ Copyright (C) 2011-2021 Natalia Portillo
|
|||||||
|
|
||||||
#include "netware.h"
|
#include "netware.h"
|
||||||
|
|
||||||
#include "consts.h"
|
#include "include/consts.h"
|
||||||
#include "defs.h"
|
#include "include/defs.h"
|
||||||
|
|
||||||
void GetOsInfo()
|
void GetOsInfo()
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetVolumeInfo(const char *path, size_t *clusterSize)
|
void GetVolumeInfo(const char* path, size_t* clusterSize)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
*clusterSize = 0;
|
*clusterSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileAttributes(const char *path)
|
void FileAttributes(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilePermissions(const char *path)
|
void FilePermissions(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtendedAttributes(const char *path)
|
void ExtendedAttributes(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceFork(const char *path)
|
void ResourceFork(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filenames(const char *path)
|
void Filenames(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timestamps(const char *path)
|
void Timestamps(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirectoryDepth(const char *path)
|
void DirectoryDepth(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fragmentation(const char *path, size_t clusterSize)
|
void Fragmentation(const char* path, size_t clusterSize)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sparse(const char *path)
|
void Sparse(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void Links(const char *path)
|
void Links(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void MillionFiles(const char *path)
|
void MillionFiles(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteFiles(const char *path)
|
void DeleteFiles(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ Copyright (C) 2011-2021 Natalia Portillo
|
|||||||
|
|
||||||
#include "os2_16.h"
|
#include "os2_16.h"
|
||||||
|
|
||||||
#include "consts.h"
|
|
||||||
#include "defs.h"
|
|
||||||
#include "dosos2.h"
|
#include "dosos2.h"
|
||||||
|
#include "include/consts.h"
|
||||||
|
#include "include/defs.h"
|
||||||
|
|
||||||
void GetOsInfo()
|
void GetOsInfo()
|
||||||
{
|
{
|
||||||
@@ -79,14 +79,14 @@ void GetOsInfo()
|
|||||||
printf("\tMaximum path is %d bytes.\n", pathLen[0]);
|
printf("\tMaximum path is %d bytes.\n", pathLen[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetVolumeInfo(const char *path, size_t *clusterSize)
|
void GetVolumeInfo(const char* path, size_t* clusterSize)
|
||||||
{
|
{
|
||||||
USHORT rc;
|
USHORT rc;
|
||||||
BYTE bData[64];
|
BYTE bData[64];
|
||||||
USHORT cbData = sizeof(bData);
|
USHORT cbData = sizeof(bData);
|
||||||
PFSALLOCATE pfsAllocateBuffer;
|
PFSALLOCATE pfsAllocateBuffer;
|
||||||
USHORT driveNo = path[0] - '@';
|
USHORT driveNo = path[0] - '@';
|
||||||
char * fsdName;
|
char* fsdName;
|
||||||
PFSINFO pfsInfo;
|
PFSINFO pfsInfo;
|
||||||
|
|
||||||
if(driveNo > 32) driveNo -= 32;
|
if(driveNo > 32) driveNo -= 32;
|
||||||
@@ -147,7 +147,7 @@ void GetVolumeInfo(const char *path, size_t *clusterSize)
|
|||||||
free(pfsInfo);
|
free(pfsInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileAttributes(const char *path)
|
void FileAttributes(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
USHORT rc = 0, wRc = 0, cRc = 0;
|
USHORT rc = 0, wRc = 0, cRc = 0;
|
||||||
@@ -530,11 +530,11 @@ void FileAttributes(const char *path)
|
|||||||
cRc);
|
cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilePermissions(const char *path)
|
void FilePermissions(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtendedAttributes(const char *path)
|
void ExtendedAttributes(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
USHORT rc = 0, wRc = 0, cRc = 0;
|
USHORT rc = 0, wRc = 0, cRc = 0;
|
||||||
@@ -638,11 +638,11 @@ void ExtendedAttributes(const char *path)
|
|||||||
printf("\tFile with icon = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "ICON", rc, wRc, cRc);
|
printf("\tFile with icon = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "ICON", rc, wRc, cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceFork(const char *path)
|
void ResourceFork(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filenames(const char *path)
|
void Filenames(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
USHORT rc = 0, wRc = 0, cRc = 0;
|
USHORT rc = 0, wRc = 0, cRc = 0;
|
||||||
@@ -701,7 +701,7 @@ void Filenames(const char *path)
|
|||||||
|
|
||||||
#define DATETIME_FORMAT "This file is dated %04d/%02d/%02d %02d:%02d:%02d for %s\n"
|
#define DATETIME_FORMAT "This file is dated %04d/%02d/%02d %02d:%02d:%02d for %s\n"
|
||||||
|
|
||||||
void Timestamps(const char *path)
|
void Timestamps(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
USHORT rc = 0, wRc = 0, cRc = 0, tRc = 0;
|
USHORT rc = 0, wRc = 0, cRc = 0, tRc = 0;
|
||||||
@@ -1328,7 +1328,7 @@ void Timestamps(const char *path)
|
|||||||
printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2K_TIME", rc, wRc, cRc, tRc);
|
printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2K_TIME", rc, wRc, cRc, tRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirectoryDepth(const char *path)
|
void DirectoryDepth(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
USHORT rc = 0;
|
USHORT rc = 0;
|
||||||
@@ -1374,14 +1374,14 @@ void DirectoryDepth(const char *path)
|
|||||||
printf("\tCreated %d levels of directory hierarchy\n", pos);
|
printf("\tCreated %d levels of directory hierarchy\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fragmentation(const char *path, size_t clusterSize)
|
void Fragmentation(const char* path, size_t clusterSize)
|
||||||
{
|
{
|
||||||
size_t halfCluster = clusterSize / 2;
|
size_t halfCluster = clusterSize / 2;
|
||||||
size_t quarterCluster = clusterSize / 4;
|
size_t quarterCluster = clusterSize / 4;
|
||||||
size_t twoCluster = clusterSize * 2;
|
size_t twoCluster = clusterSize * 2;
|
||||||
size_t threeQuartersCluster = halfCluster + quarterCluster;
|
size_t threeQuartersCluster = halfCluster + quarterCluster;
|
||||||
size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
|
size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
|
||||||
unsigned char *buffer;
|
unsigned char* buffer;
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
USHORT rc = 0, wRc = 0, cRc = 0;
|
USHORT rc = 0, wRc = 0, cRc = 0;
|
||||||
USHORT actionTaken = 0;
|
USHORT actionTaken = 0;
|
||||||
@@ -1660,15 +1660,15 @@ void Fragmentation(const char *path, size_t clusterSize)
|
|||||||
cRc);
|
cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Links(const char *path)
|
void Links(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sparse(const char *path)
|
void Sparse(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void MillionFiles(const char *path)
|
void MillionFiles(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
USHORT rc = 0;
|
USHORT rc = 0;
|
||||||
@@ -1722,7 +1722,7 @@ void MillionFiles(const char *path)
|
|||||||
printf("\tCreated %lu files\n", pos);
|
printf("\tCreated %lu files\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteFiles(const char *path)
|
void DeleteFiles(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
USHORT rc = 0;
|
USHORT rc = 0;
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ Copyright (C) 2011-2021 Natalia Portillo
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "consts.h"
|
|
||||||
#include "defs.h"
|
|
||||||
#include "dosos2.h"
|
#include "dosos2.h"
|
||||||
|
#include "include/consts.h"
|
||||||
|
#include "include/defs.h"
|
||||||
#include "os2_16.h"
|
#include "os2_16.h"
|
||||||
|
|
||||||
void GetOsInfo()
|
void GetOsInfo()
|
||||||
@@ -74,8 +74,7 @@ void GetOsInfo()
|
|||||||
|
|
||||||
printf("OS information:\n");
|
printf("OS information:\n");
|
||||||
|
|
||||||
if(aulBuffer[2] > 0x20)
|
if(aulBuffer[2] > 0x20) printf("\tRunning under OS/2 %d.%d revision %c.\n", MajorVer, MinorVer, aulBuffer[2]);
|
||||||
printf("\tRunning under OS/2 %d.%d revision %c.\n", MajorVer, MinorVer, aulBuffer[2]);
|
|
||||||
else
|
else
|
||||||
printf("\tRunning under OS/2 %d.%d\n", MajorVer, MinorVer);
|
printf("\tRunning under OS/2 %d.%d\n", MajorVer, MinorVer);
|
||||||
|
|
||||||
@@ -84,14 +83,14 @@ void GetOsInfo()
|
|||||||
printf("\tMaximum path is %lu bytes.\n", pathLen[0]);
|
printf("\tMaximum path is %lu bytes.\n", pathLen[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetVolumeInfo(const char *path, size_t *clusterSize)
|
void GetVolumeInfo(const char* path, size_t* clusterSize)
|
||||||
{
|
{
|
||||||
APIRET rc;
|
APIRET rc;
|
||||||
BYTE bData[64];
|
BYTE bData[64];
|
||||||
ULONG cbData = sizeof(bData);
|
ULONG cbData = sizeof(bData);
|
||||||
PFSALLOCATE pfsAllocateBuffer;
|
PFSALLOCATE pfsAllocateBuffer;
|
||||||
ULONG driveNo = path[0] - '@';
|
ULONG driveNo = path[0] - '@';
|
||||||
char * fsdName;
|
char* fsdName;
|
||||||
PFSINFO pfsInfo;
|
PFSINFO pfsInfo;
|
||||||
|
|
||||||
if(driveNo > 32) driveNo -= 32;
|
if(driveNo > 32) driveNo -= 32;
|
||||||
@@ -152,7 +151,7 @@ void GetVolumeInfo(const char *path, size_t *clusterSize)
|
|||||||
free(pfsInfo);
|
free(pfsInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileAttributes(const char *path)
|
void FileAttributes(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
APIRET rc = 0, wRc = 0, cRc = 0;
|
APIRET rc = 0, wRc = 0, cRc = 0;
|
||||||
@@ -552,19 +551,19 @@ void FileAttributes(const char *path)
|
|||||||
cRc);
|
cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilePermissions(const char *path)
|
void FilePermissions(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtendedAttributes(const char *path)
|
void ExtendedAttributes(const char* path)
|
||||||
{ /* TODO: Implement */
|
{ /* TODO: Implement */
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourceFork(const char *path)
|
void ResourceFork(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filenames(const char *path)
|
void Filenames(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
APIRET rc = 0, wRc = 0, cRc = 0;
|
APIRET rc = 0, wRc = 0, cRc = 0;
|
||||||
@@ -623,7 +622,7 @@ void Filenames(const char *path)
|
|||||||
|
|
||||||
#define DATETIME_FORMAT "This file is dated %04d/%02d/%02d %02d:%02d:%02d for %s\n"
|
#define DATETIME_FORMAT "This file is dated %04d/%02d/%02d %02d:%02d:%02d for %s\n"
|
||||||
|
|
||||||
void Timestamps(const char *path)
|
void Timestamps(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
APIRET rc = 0, wRc = 0, cRc = 0, tRc = 0;
|
APIRET rc = 0, wRc = 0, cRc = 0, tRc = 0;
|
||||||
@@ -1250,7 +1249,7 @@ void Timestamps(const char *path)
|
|||||||
printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2K_TIME", rc, wRc, cRc, tRc);
|
printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2K_TIME", rc, wRc, cRc, tRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirectoryDepth(const char *path)
|
void DirectoryDepth(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
APIRET rc = 0;
|
APIRET rc = 0;
|
||||||
@@ -1296,14 +1295,14 @@ void DirectoryDepth(const char *path)
|
|||||||
printf("\tCreated %d levels of directory hierarchy\n", pos);
|
printf("\tCreated %d levels of directory hierarchy\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fragmentation(const char *path, size_t clusterSize)
|
void Fragmentation(const char* path, size_t clusterSize)
|
||||||
{
|
{
|
||||||
size_t halfCluster = clusterSize / 2;
|
size_t halfCluster = clusterSize / 2;
|
||||||
size_t quarterCluster = clusterSize / 4;
|
size_t quarterCluster = clusterSize / 4;
|
||||||
size_t twoCluster = clusterSize * 2;
|
size_t twoCluster = clusterSize * 2;
|
||||||
size_t threeQuartersCluster = halfCluster + quarterCluster;
|
size_t threeQuartersCluster = halfCluster + quarterCluster;
|
||||||
size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
|
size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
|
||||||
unsigned char *buffer;
|
unsigned char* buffer;
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
APIRET rc = 0, wRc = 0, cRc = 0;
|
APIRET rc = 0, wRc = 0, cRc = 0;
|
||||||
ULONG actionTaken = 0;
|
ULONG actionTaken = 0;
|
||||||
@@ -1582,16 +1581,16 @@ void Fragmentation(const char *path, size_t clusterSize)
|
|||||||
cRc);
|
cRc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sparse(const char *path)
|
void Sparse(const char* path)
|
||||||
{ /* Do nothing, not supported by target operating system */
|
{ /* Do nothing, not supported by target operating system */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Links(const char *path)
|
void Links(const char* path)
|
||||||
{
|
{
|
||||||
// TODO: Check if can ask WPS to make Shadow
|
// TODO: Check if can ask WPS to make Shadow
|
||||||
}
|
}
|
||||||
|
|
||||||
void MillionFiles(const char *path)
|
void MillionFiles(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
APIRET rc = 0;
|
APIRET rc = 0;
|
||||||
@@ -1645,7 +1644,7 @@ void MillionFiles(const char *path)
|
|||||||
printf("\tCreated %lu files\n", pos);
|
printf("\tCreated %lu files\n", pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteFiles(const char *path)
|
void DeleteFiles(const char* path)
|
||||||
{
|
{
|
||||||
char drivePath[4];
|
char drivePath[4];
|
||||||
APIRET rc = 0;
|
APIRET rc = 0;
|
||||||
|
|||||||
@@ -36,20 +36,19 @@ Copyright (C) 2011-2021 Natalia Portillo
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/statfs.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
|
|
||||||
#include "unix.h"
|
#include "unix.h"
|
||||||
|
|
||||||
#include "../consts.h"
|
#include "../include/consts.h"
|
||||||
#include "../defs.h"
|
#include "../include/defs.h"
|
||||||
#include "../linux/linux.h"
|
#include "../linux/linux.h"
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/statfs.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/utsname.h>
|
|
||||||
|
|
||||||
void GetOsInfo()
|
void GetOsInfo()
|
||||||
{
|
{
|
||||||
struct utsname buf;
|
struct utsname buf;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user