Blender V5.0
storage_apple.mm File Reference
import <Foundation/Foundation.h>
#include <string>
#include <sys/xattr.h>
#include "BLI_fileops.h"
#include "BLI_path_utils.hh"
#include "BLI_string.h"

Go to the source code of this file.

Functions

bool BLI_file_alias_target (const char *filepath, char r_targetpath[FILE_MAXDIR])
static bool find_attribute (const std::string &attributes, const char *search_attribute)
static bool test_onedrive_file_is_placeholder (const char *path)
static bool test_file_is_offline (const char *path)
eFileAttributes BLI_file_attributes (const char *path)
char * BLI_current_working_dir (char *dir, const size_t maxncpy)
bool BLI_change_working_dir (const char *dir)

Variables

static const char * ONEDRIVE_RECALLONOPEN_ATTRIBUTE = "com.microsoft.OneDrive.RecallOnOpen"

Detailed Description

macOS specific implementations for storage.c.

Definition in file storage_apple.mm.

Function Documentation

◆ BLI_change_working_dir()

bool BLI_change_working_dir ( const char * dir)

Changes the current working directory to the provided path.

Usage of this function is strongly discouraged as it is not thread safe. It will likely cause issues if there is an operation on another thread that does not expect the current working directory to change. This has been added to support USDZ export, which has a problematic "feature" described in this issue #99807. It will be removed if it is possible to resolve that issue upstream in the USD library.

Returns
true on success, false otherwise.

Definition at line 199 of file storage_apple.mm.

References ARRAY_SIZE, BLI_assert, BLI_is_dir(), BLI_thread_is_main(), conv_utf_8_to_16(), and FILE_MAX.

Referenced by blender::io::usd::perform_usdz_conversion(), and blender::tests::TEST_F().

◆ BLI_current_working_dir()

char * BLI_current_working_dir ( char * dir,
size_t maxncpy )

Copies the current working directory into *dir (max size maxncpy), and returns a pointer to same.

Note
can return NULL when the size is not big enough

Definition at line 186 of file storage_apple.mm.

References BLI_strncpy(), BLI_strncpy_wchar_as_utf8(), length(), and PATH_MAX.

Referenced by BLI_path_abs_from_cwd(), blender::io::usd::perform_usdz_conversion(), and blender::tests::TEST_F().

◆ BLI_file_alias_target()

bool BLI_file_alias_target ( const char * filepath,
char r_targetpath[FILE_MAXDIR] )

Definition at line 22 of file storage_apple.mm.

References error(), FILE_MAXDIR, and options.

◆ BLI_file_attributes()

◆ find_attribute()

bool find_attribute ( const std::string & attributes,
const char * search_attribute )
static

◆ test_file_is_offline()

bool test_file_is_offline ( const char * path)
static

Checks if the file is marked as offline and not immediately available.

Parameters
paththe path of the file.
Returns
'true' when the file is a placeholder, otherwise 'false'.

Definition at line 117 of file storage_apple.mm.

References test_onedrive_file_is_placeholder().

Referenced by BLI_file_attributes().

◆ test_onedrive_file_is_placeholder()

bool test_onedrive_file_is_placeholder ( const char * path)
static

Checks if the file is merely a placeholder for a OneDrive file that hasn't yet been downloaded.

Parameters
paththe path of the file.
Returns
'true' when the file is a OneDrive placeholder, otherwise 'false'.

Definition at line 88 of file storage_apple.mm.

References find_attribute(), ONEDRIVE_RECALLONOPEN_ATTRIBUTE, and size().

Referenced by test_file_is_offline().

Variable Documentation

◆ ONEDRIVE_RECALLONOPEN_ATTRIBUTE

const char* ONEDRIVE_RECALLONOPEN_ATTRIBUTE = "com.microsoft.OneDrive.RecallOnOpen"
static

Definition at line 20 of file storage_apple.mm.

Referenced by test_onedrive_file_is_placeholder().