feat(Windows64): miniaudio

This commit is contained in:
str1k3r committed 2026-08-13 22:31:59 -04:00
1 parent 46caf4727c
commit a0c41b09c9
664 files changed
+103249 -14186

No files matched your search

@@ -0,0 +1,54 @@
#include "stdafx.h"
#include "Filesystem.h"
#include <windows.h>
#include <stdio.h>
bool FileOrDirectoryExists(const char* path)
{
DWORD attribs = GetFileAttributesA(path);
return (attribs != INVALID_FILE_ATTRIBUTES);
}
bool FileExists(const char* path)
{
DWORD attribs = GetFileAttributesA(path);
return (attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY));
}
bool DirectoryExists(const char* path)
{
DWORD attribs = GetFileAttributesA(path);
return (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY));
}
bool GetFirstFileInDirectory(const char* directory, char* outFilePath, size_t outFilePathSize)
{
char searchPath[MAX_PATH];
printf(searchPath, MAX_PATH, "%s\\*", directory);
WIN32_FIND_DATAA findData;
HANDLE hFind = FindFirstFileA(searchPath, &findData);
if (hFind == INVALID_HANDLE_VALUE)
{
return false;
}
do
{
if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
// Found a file, copy its path to the output buffer
printf(outFilePath, outFilePathSize, "%s\\%s", directory, findData.cFileName);
FindClose(hFind);
return true;
}
} while (FindNextFileA(hFind, &findData) != 0);
FindClose(hFind);
return false; // No files found in the directory
}
//str1k3r - credits to the smartCMD repo for this file