use native::is_text_file / is_binary_file

This commit is contained in:
Kelvin Sherlock 2016-08-01 09:32:27 -04:00
parent 23b0ae3bc4
commit 42024c54f1
4 changed files with 9 additions and 12 deletions

View File

@ -227,8 +227,8 @@ namespace MPW
// dumpobj, makelib, linkiigs don't set O_BINARY (but should)
// MPW Assembler sets O_BINARY (but shouldn't)
if (OS::IsTextFile(sname)) f.flags &= ~kO_BINARY;
if (OS::IsBinaryFile(sname)) f.flags |= kO_BINARY;
if (native::is_text_file(sname)) f.flags &= ~kO_BINARY;
if (native::is_binary_file(sname)) f.flags |= kO_BINARY;
if (f.flags & kO_RSRC) f.flags |= kO_BINARY;

View File

@ -69,7 +69,7 @@ namespace {
#if 0
std::string extension(const std::string &s)
{
std::string tmp;
@ -97,7 +97,7 @@ namespace {
return s.substr(pos + 1);
}
#endif
}
@ -119,7 +119,7 @@ namespace OS
return true;
}
#if 0
// known text file extensions
bool IsTextFile(const std::string &s)
{
@ -292,6 +292,7 @@ namespace OS
return false;
}
#endif
uint16_t Close(uint16_t trap)
{

View File

@ -29,9 +29,10 @@ namespace OS
bool Init();
/*
bool IsTextFile(const std::string &s);
bool IsBinaryFile(const std::string &s);
*/
time_t UnixToMac(time_t);
time_t MacToUnix(time_t);

View File

@ -246,11 +246,6 @@ namespace OS { namespace Internal {
std::string xname = filename;
/*
if (fork)
xname.append(_PATH_RSRCFORKSPEC);
*/
Log(" open(%s, %04x, %04x)\n", xname.c_str(), access, fork);
@ -266,7 +261,7 @@ namespace OS { namespace Internal {
auto &e = OS::Internal::FDEntry::allocate(fd, filename);
e.resource = fork;
e.text = fork ? false : IsTextFile(filename);
e.text = fork ? false : native::is_text_file(filename);
return fd;
}