Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.03.27;
Скачать: CL | DM;

Вниз

Не могу открыть на чтение файл, который занят другим процесом...   Найти похожие ветки 

 
Шурик Ш   (2005-03-11 16:39) [0]

Однако, через F3 в FARе или через блокнот в Винде он очень даже легко просматривается! Почему? И как все-таки его открыть?


 
BiN ©   (2005-03-11 16:44) [1]

Как файл открываешь?

Пробуй
CreateFile(..., FILE_SHARE_READ or FILE_SHARE_WRITE, ..


 
Шурик Ш   (2005-03-11 16:46) [2]

Пробывал:
   AssignFile(F, MLGFileName);
   FileMode := 0;
   Reset(F);

И еще пробывал:
   S := TFileStream.Create(MLGFileName, fmOpenRead);


 
BiN ©   (2005-03-11 16:50) [3]

делай
  S := TFileStream.Create(MLGFileName, fmOpenRead or fmShareDenyWrite (или fmShareDenyNone));


 
Шурик Ш   (2005-03-11 16:56) [4]

Спасибо! Помогло:
 S := TFileStream.Create(MLGFileName, fmOpenRead or fmShareDenyNone);

А что же значит, то что я добавил?


 
WhiteGuy ©   (2005-03-11 16:58) [5]

2 Шурик Ш [2]


> Пробывал:
>    AssignFile(F, MLGFileName);
>    FileMode := 0;
>    Reset(F);


Шурик, а чё такое FileMode??


 
Шурик Ш   (2005-03-11 17:08) [6]

2 WhiteGuy ©   (11.03.05 16:58) [5]
FileMode + F1


 
WhiteGuy ©   (2005-03-11 17:14) [7]


> Шурик Ш   (11.03.05 17:08) [6]
> 2 WhiteGuy ©   (11.03.05 16:58) [5]
> FileMode + F1

Ну я чиста кароче запускаю Блакнот, печятаю там "FileMode", нажымаю F1 и ничё не праисходитЪ! :)


 
Шурик Ш   (2005-03-11 17:17) [8]

WhiteGuy ©   (11.03.05 17:14) [7]
Надо в командной строке печатать! :-)

Indicates the access mode on typed and untyped files opened by the Reset procedure.

Unit

System

Category

IO routines

Delphi syntax:

var FileMode: Byte = 2;

Description

In Delphi code, FileMode determines the access mode to use when typed and untyped files (not text files) are opened using the Reset procedure.

The default FileMode is 2 (Read/Write access). Assigning another value to FileMode causes all subsequent Resets to use that mode. The SysUtils unit declares a number of file open mode constants that can be assigned to the FileMode variable.

Note: Be sure to reset FileMode before calling Reset with a read-only file. Even if you are only reading from the file, the default FileMode value (Read/Write access) will cause an attempt to open a read-only file to fail.

Warning: FileMode is declared as a variable, not as a threadvar. Therefore this variable is not thread-safe.



Страницы: 1 вся ветка

Текущий архив: 2005.03.27;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.064 c
3-1109233636
Death.
2005-02-24 11:27
2005.03.27
Как отредактировать данные БД


8-1102669878
siv14
2004-12-10 12:11
2005.03.27
вращение фигур


14-1110344458
begin...end
2005-03-09 08:00
2005.03.27
С Днём рождения! 9 марта


4-1108551201
IceBeerg
2005-02-16 13:53
2005.03.27
Beep и встроенный динамик


10-1086774323
Sea Eagle
2004-06-09 13:45
2005.03.27
OLE + StarOffice