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"
|
||||
#pragma hdrstop
|
||||
|
||||
#define __OPEN_FN
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
//#include <dos.h>
|
||||
#include <string.h>
|
||||
#include <stdio.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"
|
||||
|
||||
//
|
||||
@ -410,6 +422,11 @@ int AL_PROTO ALFile::Open()
|
||||
mlSize = buf.st_size;
|
||||
tblock = localtime( &buf.st_mtime );
|
||||
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 )
|
||||
DWORD attributes = GetFileAttributes( mName );
|
||||
if ( attributes == 0xFFFFFFFF )
|
||||
@ -419,7 +436,7 @@ int AL_PROTO ALFile::Open()
|
||||
mName.GetName(),
|
||||
GetLastError() );
|
||||
mAttributes.SetFromWin32Attributes( attributes );
|
||||
#else
|
||||
#else
|
||||
unsigned attributes;
|
||||
if ( _dos_getfileattr( mName, &attributes ) != 0 )
|
||||
return mStatus.SetError( AL_CANT_OPEN_FILE,
|
||||
@ -428,6 +445,7 @@ int AL_PROTO ALFile::Open()
|
||||
mName.GetName(),
|
||||
errno );
|
||||
mAttributes.SetFromDosAttributes( attributes );
|
||||
#endif
|
||||
#endif
|
||||
return AL_SUCCESS;
|
||||
}
|
||||
@ -594,10 +612,14 @@ int AL_PROTO ALFile::Close()
|
||||
miHandle = -1;
|
||||
ALStorage::Close();
|
||||
if ( miCreated && mTimeDate.Valid() ) {
|
||||
#if XVT_OS == XVT_OS_SCOUNIX
|
||||
// TBI code for setting UNIX attributes
|
||||
#else
|
||||
#if defined( AL_WIN32S )
|
||||
SetFileAttributes( mName, mAttributes.GetWin32Attributes() );
|
||||
#else
|
||||
_dos_setfileattr( mName, mAttributes.GetDosAttributes() );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return mStatus;
|
||||
|
Loading…
x
Reference in New Issue
Block a user