1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- {
- This file is part of the Free Pascal run time library.
- Copyright (c) 2012 by the Free Pascal development team
- File utility calls
- See the file COPYING.FPC, included in this distribution,
- for details about the copyright.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- **********************************************************************}
- {$ifndef SYSUTILS_HAS_UNICODESTR_FILEUTIL_IMPL}
- Function FileOpen (Const FileName : unicodestring; Mode : Integer) : THandle;
- begin
- Result:=FileOpen(ToSingleByteFileSystemEncodedFileName(FileName),Mode);
- end;
- Function FileCreate (Const FileName : UnicodeString) : THandle;
- begin
- Result:=FileCreate(ToSingleByteFileSystemEncodedFileName(FileName));
- end;
- Function FileCreate (Const FileName : UnicodeString; Rights : Integer) : THandle;
- begin
- Result:=FileCreate(ToSingleByteFileSystemEncodedFileName(FileName),Rights);
- end;
- Function FileCreate (Const FileName : UnicodeString; ShareMode : Integer; Rights : Integer) : THandle;
- begin
- Result:=FileCreate(ToSingleByteFileSystemEncodedFileName(FileName),ShareMode,Rights);
- end;
- {$endif}
- {$ifndef SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}
- Function FileOpen (Const FileName : rawbytestring; Mode : Integer) : THandle;
- begin
- Result:=FileOpen(UnicodeString(FileName),Mode);
- end;
- Function FileCreate (Const FileName : RawByteString) : THandle;
- begin
- Result:=FileCreate(UnicodeString(FileName));
- end;
- Function FileCreate (Const FileName : RawByteString; Rights : Integer) : THandle;
- begin
- Result:=FileCreate(UnicodeString(FileName),Rights);
- end;
- Function FileCreate (Const FileName : RawByteString; ShareMode : Integer; Rights : Integer) : THandle;
- begin
- Result:=FileCreate(UnicodeString(FileName),ShareMode,Rights);
- end;
- {$endif}
- Function GetFileHandle(var f : File):THandle;
- begin
- Result:=filerec(f).handle;
- end;
- Function GetFileHandle(var f : Text):THandle;
- begin
- Result:=textrec(f).handle;
- end;
|