Форум: "Основная";
Текущий архив: 2002.01.08;
Скачать: [xml.tar.bz2];
ВнизА можно заблокировать доступ к папке,что-то типа fmShareExclusive ,но для папки??? Найти похожие ветки
← →
cdaDmitriy (2001-12-19 09:31) [13]> Алексей Петров ©
1. В имени директории конечный "\" - лишний.
он не лишний а избыточный :
lpFileName
Points to a null-terminated string that specifies the name of the object (file, pipe, mailslot, communications resource, disk device, console, or directory) to create or open.
If *lpFileName is a path, there is a default string size limit of MAX_PATH characters. This limit is related to how the CreateFile function parses paths.
Windows NT: You can use paths longer than MAX_PATH characters by calling the wide (W) version of CreateFile and prepending "\\?\" to the path. The "\\?\" tells the function to turn off path parsing. This lets you use paths that are nearly 32,000 Unicode characters long. You must use fully-qualified paths with this technique. This also works with UNC names. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and "\\?\UNC\tom_1\hotstuff\coolapps" is seen as "\\tom_1\hotstuff\coolapps".
2. посмотри реализацию unit Classes; хотя
Win32Check(H<>INVALID_HANDLE_VALUE) надежней.
{ TFileStream }
constructor TFileStream.Create(const FileName: string; Mode: Word);
begin
if Mode = fmCreate then
begin
FHandle := FileCreate(FileName);
if FHandle < 0 then
raise EFCreateError.CreateResFmt(@SFCreateError, [FileName]);
end else
begin
FHandle := FileOpen(FileName, Mode);
if FHandle < 0 then
raise EFOpenError.CreateResFmt(@SFOpenError, [FileName]);
end;
end;
Art © все работает если хочешь пиши пришлю
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2002.01.08;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.007 c