Skip to content

Commit

Permalink
Genie: Support resfile mkdir without FSSpec calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuran committed Mar 2, 2023
1 parent a1cf257 commit 1977571
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions lamp/Genie/Genie/FS/ResFile_Dir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <sys/stat.h>

// mac-rsrc-utils
#include "mac_rsrc/create_res_file.hh"
#include "mac_rsrc/open_res_file.hh"

// poseven
Expand Down Expand Up @@ -151,30 +152,9 @@ namespace Genie
{
const FSSpec& fileSpec = *(FSSpec*) that->extra();

CInfoPBRec cInfo = {{ 0 }};
using mac::rsrc::create_res_file;

const bool exists = FSpGetCatInfo< FNF_Returns >( cInfo, false, fileSpec );

::OSType creator;
::OSType type;

if ( !exists || is_rsrc_file( cInfo, fileSpec.name ) )
{
creator = 'RSED';
type = 'rsrc';
}
else
{
const FInfo& fInfo = cInfo.hFileInfo.ioFlFndrInfo;

creator = fInfo.fdCreator;
type = fInfo.fdType;
}

N::FSpCreateResFile( fileSpec,
Mac::FSCreator( creator ),
Mac::FSType ( type ),
Mac::smSystemScript );
Mac::ThrowOSStatus( create_res_file( fileSpec ) );
}

static vfs::node_ptr resfile_dir_lookup( const vfs::node* that,
Expand Down

0 comments on commit 1977571

Please sign in to comment.