Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 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
1-22091
Mikhalyov Dmitry
2001-12-19 16:02
2002.01.08
вопрос из Pascal


4-22459
YUS
2001-11-01 03:13
2002.01.08
Мастера, помогите..


14-22403
Burmistroff
2001-11-11 20:13
2002.01.08
Супер справочник по Delphi -2. Ваше мнение, please.


7-22441
ulysses
2001-09-19 20:31
2002.01.08
Delphi 5 Ent не ставится нормально под Win2k Pro


4-22498
cher_gvf
2001-11-05 20:12
2002.01.08
Как узнать запущен ли такой процесс?





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский