1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
17 //----------------------------------------------------------------------------
18 //------------------- Linux Sources of OSD_FileNode --------------------------
19 //----------------------------------------------------------------------------
21 #include <OSD_FileNode.hxx>
22 #include <OSD_OSDError.hxx>
23 #include <OSD_Path.hxx>
24 #include <OSD_Protection.hxx>
25 #include <OSD_WhoAmI.hxx>
26 #include <Quantity_Date.hxx>
27 #include <Standard_NullObject.hxx>
28 #include <Standard_ProgramError.hxx>
37 const OSD_WhoAmI Iam = OSD_WFileNode;
40 // Create a file/directory object
42 OSD_FileNode::OSD_FileNode ()
46 // Create and initialize a file/directory object
48 OSD_FileNode::OSD_FileNode (const OSD_Path& Name)
55 // Get values of object
57 void OSD_FileNode::Path (OSD_Path& Name)const{
64 // Set values of object
66 void OSD_FileNode::SetPath (const OSD_Path& Name){
74 // Test if specified file/directory exists
76 Standard_Boolean OSD_FileNode::Exists(){
80 // if (myPath.Name().Length()==0) A directory can have a null name field (ex: root)
81 // OSD_OSDError::Raise("OSD_FileNode::Exists : no name was given"); (LD)
83 // if (Failed()) Perror();
85 TCollection_AsciiString aBuffer;
86 myPath.SystemName ( aBuffer );
87 status = access ( aBuffer.ToCString() , F_OK );
89 if (status == 0) return (Standard_True);
90 else return ( Standard_False );
96 // Physically remove a file/directory
98 void OSD_FileNode::Remove(){
100 // if (myPath.Name().Length()==0) A directory can have a null name field (ex: root)
101 // OSD_OSDError::Raise("OSD_FileNode::Remove : no name was given"); (LD)
103 // if (Failed()) Perror();
105 TCollection_AsciiString aBuffer;
106 myPath.SystemName ( aBuffer );
108 if(access(aBuffer.ToCString(), W_OK))
110 myError.SetValue (errno, Iam, "Remove");
114 struct stat stat_buf;
116 if(stat(aBuffer.ToCString(), &stat_buf))
118 myError.SetValue (errno, Iam, "Remove");
122 if ( S_ISDIR(stat_buf.st_mode)) {
125 if(rmdir(aBuffer.ToCString()))
127 myError.SetValue (errno, Iam, "Remove");
133 else if ( S_ISREG(stat_buf.st_mode) || S_ISLNK(stat_buf.st_mode) ||
134 S_ISFIFO(stat_buf.st_mode) ) {
136 if (unlink ( aBuffer.ToCString()) == -1)
137 myError.SetValue (errno, Iam, "Remove");
140 myError.SetValue (EINVAL, Iam, "Remove");
147 // Move a file/directory to another path
149 void OSD_FileNode::Move(const OSD_Path& NewPath){
151 TCollection_AsciiString thisPath;
153 // if (myPath.Name().Length()==0)
154 // OSD_OSDError::Raise("OSD_FileNode::Move : no name was given");
156 // if (Failed()) Perror();
158 NewPath.SystemName( thisPath ); // Get internal path name
159 TCollection_AsciiString aBuffer;
160 myPath.SystemName ( aBuffer );
161 status = rename (aBuffer.ToCString(), thisPath.ToCString());
163 if (status == -1) myError.SetValue (errno, Iam, "Move");
166 // Copy a file to another path and name
167 int static copy_file( const char* src, const char* trg )
171 int fds = open( src, O_RDONLY );
175 int fdo = open( trg, O_WRONLY|O_TRUNC| O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
183 const int BUFSIZE=4096;
186 while ( ( n = read ( fds, buf, BUFSIZE )) >0 )
188 if ( write ( fdo, buf, n ) != n ) { // writing error
203 void OSD_FileNode::Copy(const OSD_Path& ToPath)
206 TCollection_AsciiString second_name;
208 // if (myPath.Name().Length()==0) Copy .login would raise !!
209 // OSD_OSDError::Raise("OSD_FileNode::Copy : no name was given");
210 // if (Failed()) Perror();
212 ToPath.SystemName (second_name);
214 TCollection_AsciiString aBuffer;
215 myPath.SystemName ( aBuffer );
216 status = copy_file(aBuffer.ToCString(), second_name.ToCString());
217 if (status != 0) myError.SetValue (-1, Iam, "Copy failed") ;// (LD)
219 printf("Status %d : errno # %d\n",status,errno);
227 // Get protections of a file/directory
229 OSD_Protection OSD_FileNode::Protection(){
230 OSD_Protection thisProt;
235 // if (myPath.Name().Length()==0)
236 // OSD_OSDError::Raise("OSD_FileNode::Protection : no name was given");
238 // if (Failed()) Perror();
240 TCollection_AsciiString aBuffer;
241 myPath.SystemName ( aBuffer );
242 status = stat(aBuffer.ToCString(), &myStat);
243 if (status == -1) myError.SetValue (errno, Iam, "Protection");
245 u = g = w = OSD_None;
247 if (myStat.st_mode & S_IRUSR) u |= OSD_R;
248 if (myStat.st_mode & S_IWUSR) u |= OSD_W;
249 if (myStat.st_mode & S_IXUSR) u |= OSD_X;
251 if (myStat.st_mode & S_IRGRP) g |= OSD_R;
252 if (myStat.st_mode & S_IWGRP) g |= OSD_W;
253 if (myStat.st_mode & S_IXGRP) g |= OSD_X;
255 if (myStat.st_mode & S_IROTH) w |= OSD_R;
256 if (myStat.st_mode & S_IWOTH) w |= OSD_W;
257 if (myStat.st_mode & S_IXOTH) w |= OSD_X;
260 thisProt.SetValues ((OSD_SingleProtection)s,
261 (OSD_SingleProtection)u,
262 (OSD_SingleProtection)g,
263 (OSD_SingleProtection)w);
269 // Set protections of a file/directory
271 void OSD_FileNode::SetProtection(const OSD_Protection& Prot){
274 // if (myPath.Name().Length()==0)
275 // OSD_OSDError::Raise("OSD_FileNode::SetProtection : no name was given");
277 // if (Failed()) Perror();
279 TCollection_AsciiString aBuffer;
280 myPath.SystemName ( aBuffer );
281 status = chmod (aBuffer.ToCString(), (mode_t)Prot.Internal() );
282 if (status == -1) myError.SetValue (errno, Iam, "SetProtection");
285 // return the date of last access of file/directory
287 Quantity_Date OSD_FileNode::CreationMoment(){
289 Quantity_Date result;
293 // if (myPath.Name().Length()==0)
294 // OSD_OSDError::Raise("OSD_FileNode::CreationMoment : no name was given");
296 // if (Failed()) Perror();
298 /* Get File Informations */
300 TCollection_AsciiString aBuffer;
301 myPath.SystemName ( aBuffer );
302 if (!stat ( aBuffer.ToCString(), &buffer )) {
303 time_t aTime = (time_t)buffer.st_ctime;
304 decode = localtime (&aTime);
305 result.SetValues (decode->tm_mon+1, decode->tm_mday, decode->tm_year+1900,
306 decode->tm_hour, decode->tm_min, decode->tm_sec , 0,0);
309 result.SetValues (1, 1, 1979, 0, 0, 0, 0, 0) ;
313 // return Last access of file/directory
315 Quantity_Date OSD_FileNode::AccessMoment(){
317 Quantity_Date result;
321 // if (myPath.Name().Length()==0)
322 // OSD_OSDError::Raise("OSD_FileNode::AccessMoment : no name was given");
324 // if (Failed()) Perror();
326 /* Get File Informations */
328 TCollection_AsciiString aBuffer;
329 myPath.SystemName ( aBuffer );
330 if (!stat ( aBuffer.ToCString(), &buffer )) {
331 time_t aTime = (time_t)buffer.st_ctime;
332 decode = localtime (&aTime);
333 result.SetValues (decode->tm_mon+1, decode->tm_mday, decode->tm_year+1900,
334 decode->tm_hour, decode->tm_min, decode->tm_sec, 0,0 );
337 result.SetValues (1, 1, 1979, 0, 0, 0, 0, 0) ;
342 void OSD_FileNode::Reset(){
346 Standard_Boolean OSD_FileNode::Failed()const{
347 return( myError.Failed());
350 void OSD_FileNode::Perror() {
355 Standard_Integer OSD_FileNode::Error()const{
356 return( myError.Error());
361 //----------------------------------------------------------------------------
362 //------------------- WNT Sources of OSD_FileNode ---------------------------
363 //----------------------------------------------------------------------------
371 #include <OSD_FileNode.hxx>
372 #include <OSD_Protection.hxx>
373 #include <Quantity_Date.hxx>
374 #include <Standard_ProgramError.hxx>
375 #include <TCollection_ExtendedString.hxx>
377 #include <OSD_WNT_1.hxx>
385 #define TEST_RAISE( arg ) _test_raise ( fName, ( arg ) )
386 #define RAISE( arg ) Standard_ProgramError :: Raise ( ( arg ) )
389 // None of the existing security APIs are supported in a UWP applications
390 PSECURITY_DESCRIPTOR __fastcall _osd_wnt_protection_to_sd ( const OSD_Protection&, BOOL, wchar_t* = NULL );
391 BOOL __fastcall _osd_wnt_sd_to_protection (
392 PSECURITY_DESCRIPTOR pSD, OSD_Protection& prot, BOOL
395 Standard_Integer __fastcall _get_file_type ( Standard_CString, HANDLE );
397 void _osd_wnt_set_error ( OSD_Error&, OSD_WhoAmI, ... );
399 static BOOL __fastcall _get_file_time ( Standard_ExtString, LPSYSTEMTIME, BOOL );
400 static void __fastcall _test_raise ( TCollection_AsciiString, Standard_CString );
402 //=======================================================================
403 //function : OSD_FileNode
404 //purpose : Empty Constructor
405 //=======================================================================
407 OSD_FileNode::OSD_FileNode ()
411 //=======================================================================
412 //function : OSD_FileNode
413 //purpose : Constructor
414 //=======================================================================
416 OSD_FileNode::OSD_FileNode ( const OSD_Path& Name )
419 } // end constructor ( 2 )
421 //=======================================================================
424 //=======================================================================
426 void OSD_FileNode::Path ( OSD_Path& Name ) const {
430 } // end OSD_FileNode :: Path
432 //=======================================================================
435 //=======================================================================
437 void OSD_FileNode::SetPath ( const OSD_Path& Name ) {
441 } // end OSD_FileNode :: SetPath
443 //=======================================================================
446 //=======================================================================
448 Standard_Boolean OSD_FileNode::Exists () {
450 Standard_Boolean retVal = Standard_False;;
451 TCollection_AsciiString fName;
453 myPath.SystemName ( fName );
455 if ( fName.IsEmpty () ) return Standard_False;
456 TEST_RAISE( "Exists" );
458 // make wide character string from UTF-8
459 TCollection_ExtendedString fNameW(fName);
461 WIN32_FILE_ATTRIBUTE_DATA aFileInfo;
463 if ( !GetFileAttributesExW((const wchar_t*)fNameW.ToExtString(), GetFileExInfoStandard, &aFileInfo)) {
465 if ( GetLastError () != ERROR_FILE_NOT_FOUND )
466 _osd_wnt_set_error(myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString());
470 retVal = Standard_True;
474 } // end OSD_FileNode :: Exists
476 //=======================================================================
479 //=======================================================================
481 void OSD_FileNode::Remove () {
483 TCollection_AsciiString fName;
485 myPath.SystemName ( fName );
486 TCollection_ExtendedString fNameW(fName);
488 TEST_RAISE( "Remove" );
490 switch (_get_file_type (fName.ToCString(), INVALID_HANDLE_VALUE)) {
494 if ( !DeleteFileW ( (const wchar_t*) fNameW.ToExtString () ) )
495 _osd_wnt_set_error ( myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString());
501 // LD : Suppression de l'appel a DeleteDirectory pour
502 // ne pas detruire un repertoire no vide.
504 if ( !RemoveDirectoryW ( (const wchar_t*) fNameW.ToExtString () ) )
505 _osd_wnt_set_error ( myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString());
509 RAISE("OSD_FileNode :: Remove (): invalid file type - neither file nor directory");
512 } // end OSD_FileNode :: Remove
514 //=======================================================================
517 //=======================================================================
519 void OSD_FileNode::Move ( const OSD_Path& NewPath ) {
521 TCollection_AsciiString fName;
522 TCollection_AsciiString fNameDst;
524 myPath.SystemName ( fName );
525 TCollection_ExtendedString fNameW(fName);
527 TEST_RAISE( "Move" );
529 NewPath.SystemName ( fNameDst );
530 TCollection_ExtendedString fNameDstW(fNameDst);
532 switch (_get_file_type (fName.ToCString (), INVALID_HANDLE_VALUE)) {
536 if (!MoveFileExW ((const wchar_t*)fNameW.ToExtString (),
537 (const wchar_t*)fNameDstW.ToExtString (),
538 MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED
541 _osd_wnt_set_error(myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString(), (const wchar_t*)fNameDstW.ToExtString());
546 if ( !MoveDirectory (
547 (const wchar_t*) fNameW.ToExtString (), (const wchar_t*) fNameDstW.ToExtString ()
550 _osd_wnt_set_error(myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString(), (const wchar_t*)fNameDstW.ToExtString());
554 RAISE("OSD_FileNode :: Move (): invalid file type - neither file nor directory");
557 } // end OSD_FileNode :: Move
559 //=======================================================================
562 //=======================================================================
564 void OSD_FileNode::Copy ( const OSD_Path& ToPath ) {
566 TCollection_AsciiString fName;
567 TCollection_AsciiString fNameDst;
569 myPath.SystemName ( fName );
570 TCollection_ExtendedString fNameW(fName);
572 TEST_RAISE( "Copy" );
574 ToPath.SystemName ( fNameDst );
575 TCollection_ExtendedString fNameDstW(fNameDst);
577 switch (_get_file_type (fName.ToCString(), INVALID_HANDLE_VALUE)) {
581 if (!CopyFileW((const wchar_t*)fNameW.ToExtString(),
582 (const wchar_t*)fNameDstW.ToExtString(), FALSE))
584 if (CopyFile2((const wchar_t*)fNameW.ToExtString (),
585 (const wchar_t*)fNameDstW.ToExtString (), FALSE ) != S_OK)
587 _osd_wnt_set_error(myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString(), (const wchar_t*)fNameDstW.ToExtString());
592 if ( !CopyDirectory (
593 (const wchar_t*)fNameW.ToExtString (), (const wchar_t*)fNameDstW.ToExtString ()
597 _osd_wnt_set_error(myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString(), (const wchar_t*)fNameDstW.ToExtString());
602 RAISE("OSD_FileNode :: Copy (): invalid file type - neither file nor directory");
606 } // end OSD_FileNode :: Copy
608 // None of the existing security APIs are supported in a UWP applications
611 //=======================================================================
612 //function : Protection
614 //=======================================================================
616 OSD_Protection OSD_FileNode::Protection () {
618 OSD_Protection retVal;
619 TCollection_AsciiString fName;
620 PSECURITY_DESCRIPTOR pSD;
622 myPath.SystemName ( fName );
623 TCollection_ExtendedString fNameW(fName);
625 TEST_RAISE( "Protection" );
627 if ( ( pSD = GetFileSecurityEx (
628 (const wchar_t*) fNameW.ToExtString (), DACL_SECURITY_INFORMATION |
629 OWNER_SECURITY_INFORMATION
632 !_osd_wnt_sd_to_protection (
634 _get_file_type (fName.ToCString(), INVALID_HANDLE_VALUE) == FLAG_DIRECTORY)
637 _osd_wnt_set_error ( myError, OSD_WFileNode );
641 FreeFileSecurity ( pSD );
645 } // end OSD_FileNode :: Protection
647 //=======================================================================
648 //function : SetProtection
650 //=======================================================================
652 void OSD_FileNode::SetProtection ( const OSD_Protection& Prot ) {
654 TCollection_AsciiString fName;
655 PSECURITY_DESCRIPTOR pSD;
657 myPath.SystemName ( fName );
658 TCollection_ExtendedString fNameW(fName);
660 TEST_RAISE( "SetProtection" );
662 pSD = _osd_wnt_protection_to_sd (
664 _get_file_type (fName.ToCString(), INVALID_HANDLE_VALUE) ==
666 (wchar_t *)fNameW.ToExtString ()
669 if ( pSD == NULL || !SetFileSecurityW (
670 (const wchar_t*) fNameW.ToExtString (), DACL_SECURITY_INFORMATION, pSD
673 _osd_wnt_set_error ( myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString());
679 } // end OSD_FileNode :: SetProtection
685 //=======================================================================
686 //function : Protection
688 //=======================================================================
690 OSD_Protection OSD_FileNode::Protection ()
692 TCollection_AsciiString fName;
694 myPath.SystemName ( fName );
695 TCollection_ExtendedString fNameW(fName);
697 OSD_SingleProtection aProt = OSD_None;
698 if (_waccess_s ((const wchar_t*)fNameW.ToExtString(), 6))
700 else if (_waccess_s ((const wchar_t*)fNameW.ToExtString(), 2))
702 else if (_waccess_s ((const wchar_t*)fNameW.ToExtString(), 4))
705 // assume full access for system and none for everybody
706 OSD_Protection retVal (OSD_RWXD, aProt, aProt, OSD_None);
708 } // end OSD_FileNode :: Protection
710 //=======================================================================
711 //function : SetProtection
713 //=======================================================================
715 void OSD_FileNode::SetProtection ( const OSD_Protection& /*Prot*/ )
717 } // end OSD_FileNode :: SetProtection
721 //=======================================================================
722 //function : AccessMoment
724 //=======================================================================
726 Quantity_Date OSD_FileNode::AccessMoment () {
728 Quantity_Date retVal;
729 SYSTEMTIME stAccessMoment;
730 SYSTEMTIME stAccessSystemMoment;
731 TCollection_AsciiString fName;
733 myPath.SystemName ( fName );
734 TCollection_ExtendedString fNameW(fName);
736 TEST_RAISE( "AccessMoment" );
738 // if ( _get_file_time ( fName.ToCString (), &stAccessMoment, TRUE ) )
739 if ( _get_file_time ( fNameW.ToExtString (), &stAccessSystemMoment, TRUE ) )
742 SYSTEMTIME * aSysTime = &stAccessMoment;
743 BOOL aFlag = SystemTimeToTzSpecificLocalTime (NULL ,
744 &stAccessSystemMoment ,
746 if (aFlag == 0) // AGV: test for success (e.g., unsupported on Win95/98)
747 aSysTime = &stAccessSystemMoment;
748 retVal.SetValues (aSysTime->wMonth, aSysTime->wDay,
749 aSysTime->wYear, aSysTime->wHour,
750 aSysTime->wMinute, aSysTime->wSecond,
751 aSysTime->wMilliseconds
755 _osd_wnt_set_error ( myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString());
759 } // end OSD_FileNode :: AccessMoment
761 //=======================================================================
762 //function : CreationMoment
764 //=======================================================================
766 Quantity_Date OSD_FileNode::CreationMoment () {
768 Quantity_Date retVal;
769 SYSTEMTIME stCreationMoment;
770 SYSTEMTIME stCreationSystemMoment;
771 TCollection_AsciiString fName;
773 myPath.SystemName ( fName );
774 TCollection_ExtendedString fNameW(fName);
776 TEST_RAISE( "CreationMoment" );
778 // if ( _get_file_time ( fName.ToCString (), &stCreationMoment, FALSE ) )
779 if ( _get_file_time ( fNameW.ToExtString (), &stCreationSystemMoment, TRUE ) )
782 SYSTEMTIME * aSysTime = &stCreationMoment;
783 BOOL aFlag = SystemTimeToTzSpecificLocalTime (NULL,
784 &stCreationSystemMoment ,
786 if (aFlag == 0) // AGV: test for success (e.g., unsupported on Win95/98)
787 aSysTime = &stCreationSystemMoment;
788 retVal.SetValues (aSysTime->wMonth, aSysTime->wDay,
789 aSysTime->wYear, aSysTime->wHour,
790 aSysTime->wMinute, aSysTime->wSecond,
791 aSysTime->wMilliseconds
795 _osd_wnt_set_error ( myError, OSD_WFileNode, (const wchar_t*)fNameW.ToExtString());
799 } // end OSD_FileNode :: CreationMoment
801 //=======================================================================
804 //=======================================================================
806 Standard_Boolean OSD_FileNode::Failed () const {
808 return myError.Failed ();
810 } // end OSD_FileNode :: Failed
812 //=======================================================================
815 //=======================================================================
817 void OSD_FileNode::Reset () {
821 } // end OSD_FileNode :: Reset
823 //=======================================================================
826 //=======================================================================
828 void OSD_FileNode::Perror () {
832 } // end OSD_FileNode :: Perror
834 //=======================================================================
837 //=======================================================================
839 Standard_Integer OSD_FileNode::Error () const {
841 return myError.Error ();
843 } // end OSD_FileNode :: Error
845 void _osd_wnt_set_error ( OSD_Error& err, OSD_WhoAmI who, ... ) {
849 wchar_t buffer[2048];
853 va_start ( arg_ptr, who);
855 errCode = GetLastError ();
857 if ( !FormatMessageW (
858 FORMAT_MESSAGE_FROM_SYSTEM,
859 0, errCode, MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL ),
860 buffer, 2048, &arg_ptr
863 StringCchPrintfW(buffer, _countof(buffer), L"error code %d", (Standard_Integer)errCode);
865 SetLastError ( errCode );
870 WideCharToMultiByte(CP_UTF8, 0, buffer, -1, aBufferA, sizeof(aBufferA), NULL, NULL);
871 err.SetValue(errCode, who, aBufferA);
877 #if defined(__CYGWIN32__) || defined(__MINGW32__)
880 #define __leave return retVal
883 static BOOL __fastcall _get_file_time (
884 Standard_ExtString fName, LPSYSTEMTIME lpSysTime, BOOL fAccess
888 FILETIME ftCreationTime;
889 FILETIME ftLastWriteTime;
891 HANDLE hFile = INVALID_HANDLE_VALUE;
895 if ((hFile = CreateFileW((const wchar_t*)fName, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)
896 ) == INVALID_HANDLE_VALUE
899 CREATEFILE2_EXTENDED_PARAMETERS pCreateExParams = {};
900 pCreateExParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
901 pCreateExParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
902 pCreateExParams.lpSecurityAttributes = NULL;
903 pCreateExParams.hTemplateFile = NULL;
904 if ((hFile = CreateFile2(
905 (const wchar_t*)fName, NULL, NULL,
906 OPEN_EXISTING, &pCreateExParams)
907 ) == INVALID_HANDLE_VALUE
912 if ( !GetFileTime ( hFile, &ftCreationTime, NULL, &ftLastWriteTime ) ) __leave;
914 lpftPtr = fAccess ? &ftLastWriteTime : &ftCreationTime;
916 if ( !FileTimeToSystemTime ( lpftPtr, lpSysTime ) ) __leave;
924 if ( hFile != INVALID_HANDLE_VALUE )
926 CloseHandle ( hFile );
931 leave: ; // added for VisualAge
936 } // end _get_file_time
938 #if defined(__CYGWIN32__) || defined(__MINGW32__)
944 static void __fastcall _test_raise ( TCollection_AsciiString fName, Standard_CString str ) {
945 if ( fName.IsEmpty () ) {
946 TCollection_AsciiString buff = "OSD_FileNode :: ";
948 buff += " (): wrong access";
950 Standard_ProgramError::Raise(buff.ToCString());