U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » How to check, if a file is locked by another application?
How to check, if a file is locked by another application? [message #7245] Tue, 19 December 2006 13:04 Go to next message
WebChaot is currently offline  WebChaot
Messages: 53
Registered: September 2006
Location: Austria, Vienna
Member
Hi all!

I need to read in some text files and parse them. These text files are transferred by ftp.

For reading them I found two solutions:

LoadFile(...)

and

FileIn in(...)

if (in)
...

But I have to prevent my service to read files, which are not finished (to transfer). So what happens with "LoadFile" or with "in" when file is still in progress? Is there a way to check, whether a file is "locked" by another application or not?

Thanks in advance,

WebChaot.
Re: How to check, if a file is locked by another application? [message #7246 is a reply to message #7245] Tue, 19 December 2006 13:26 Go to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Well you can use FileStream instead of FileIn and use
::Open(const char* filename, READWRITE | NOREADSHARE | NOWRITESHARE)

[Edit: ] you can use FileStream(const char* filename, READWRITE | NOREADSHARE | NOWRITESHARE) , too

this way you try to open the file exclusive.

Bas

[Updated on: Tue, 19 December 2006 13:30]

Report message to a moderator

Previous Topic: How to cast String to int64?
Next Topic: brc sample problem
Goto Forum:
  


Current Time: Mon Apr 27 13:22:45 GMT+2 2026

Total time taken to generate the page: 0.00769 seconds