echiss'aricordacchiu'
git-svn-id: svn://10.65.10.50/trunk@306 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a20472dccc
commit
80115f00e0
@ -42,16 +42,28 @@
|
|||||||
#include "arclib.h"
|
#include "arclib.h"
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
|
|
||||||
|
#define __OPEN_FN
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
//#include <dos.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <xvtility.h>
|
||||||
|
|
||||||
|
#if XVT_OS == XVT_OS_SCOUNIX
|
||||||
|
#ifndef O_BINARY
|
||||||
|
#define O_BINARY 0x0000
|
||||||
|
#endif
|
||||||
|
#else // not UNIX
|
||||||
|
#include <dos.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "filestor.h"
|
#include "filestor.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -410,6 +422,11 @@ int AL_PROTO ALFile::Open()
|
|||||||
mlSize = buf.st_size;
|
mlSize = buf.st_size;
|
||||||
tblock = localtime( &buf.st_mtime );
|
tblock = localtime( &buf.st_mtime );
|
||||||
mTimeDate.SetTimeDate( tblock );
|
mTimeDate.SetTimeDate( tblock );
|
||||||
|
#if XVT_OS == XVT_OS_SCOUNIX
|
||||||
|
// TBI code for UNIX attributes
|
||||||
|
// stat s;
|
||||||
|
// mAttributes = SetFromUnixMode(stat.st_mode)
|
||||||
|
#else
|
||||||
#if defined( AL_WIN32S )
|
#if defined( AL_WIN32S )
|
||||||
DWORD attributes = GetFileAttributes( mName );
|
DWORD attributes = GetFileAttributes( mName );
|
||||||
if ( attributes == 0xFFFFFFFF )
|
if ( attributes == 0xFFFFFFFF )
|
||||||
@ -419,7 +436,7 @@ int AL_PROTO ALFile::Open()
|
|||||||
mName.GetName(),
|
mName.GetName(),
|
||||||
GetLastError() );
|
GetLastError() );
|
||||||
mAttributes.SetFromWin32Attributes( attributes );
|
mAttributes.SetFromWin32Attributes( attributes );
|
||||||
#else
|
#else
|
||||||
unsigned attributes;
|
unsigned attributes;
|
||||||
if ( _dos_getfileattr( mName, &attributes ) != 0 )
|
if ( _dos_getfileattr( mName, &attributes ) != 0 )
|
||||||
return mStatus.SetError( AL_CANT_OPEN_FILE,
|
return mStatus.SetError( AL_CANT_OPEN_FILE,
|
||||||
@ -428,6 +445,7 @@ int AL_PROTO ALFile::Open()
|
|||||||
mName.GetName(),
|
mName.GetName(),
|
||||||
errno );
|
errno );
|
||||||
mAttributes.SetFromDosAttributes( attributes );
|
mAttributes.SetFromDosAttributes( attributes );
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
return AL_SUCCESS;
|
return AL_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -594,10 +612,14 @@ int AL_PROTO ALFile::Close()
|
|||||||
miHandle = -1;
|
miHandle = -1;
|
||||||
ALStorage::Close();
|
ALStorage::Close();
|
||||||
if ( miCreated && mTimeDate.Valid() ) {
|
if ( miCreated && mTimeDate.Valid() ) {
|
||||||
|
#if XVT_OS == XVT_OS_SCOUNIX
|
||||||
|
// TBI code for setting UNIX attributes
|
||||||
|
#else
|
||||||
#if defined( AL_WIN32S )
|
#if defined( AL_WIN32S )
|
||||||
SetFileAttributes( mName, mAttributes.GetWin32Attributes() );
|
SetFileAttributes( mName, mAttributes.GetWin32Attributes() );
|
||||||
#else
|
#else
|
||||||
_dos_setfileattr( mName, mAttributes.GetDosAttributes() );
|
_dos_setfileattr( mName, mAttributes.GetDosAttributes() );
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return mStatus;
|
return mStatus;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user