Hi everybody,
I tried to find some information about my subject with google, but I
didn't find anything.
I need to read a text file, process the entire content, then kill. In
the meantime I have to be sure that no one could write on it. So I
opened with read write lock, but when i closed it, before deleting,
someone wrote something, and I lost the information because immediately
after I killed it.
Have you any suggestion?
Sorry for my bad english.
Thanks in advance,
Alessandro Noro 4 2431
Alessandro wrote: Hi everybody, I tried to find some information about my subject with google, but I didn't find anything.
I need to read a text file, process the entire content, then kill. In the meantime I have to be sure that no one could write on it. So I opened with read write lock, but when i closed it, before deleting, someone wrote something, and I lost the information because immediately after I killed it.
Have you any suggestion?
Rename the file before you start reading it. That way, any writer will
(presumably) find the file missing, and create a new blank one to write
to.
I guess we are talking about parsing a log file or something like that?
Sorry for my bad english.
Better than my Italian.
--
Larry Lard
Replies to group please
Thanks Larry for your quick reply.
I thought about the solution You suggest me, but unfortunately I cannot
do so, because I could delete the Input file only if I could find other
files (depending on what I find inside the Input file). Otherwhise I
have to wait, and leave the Input file "free" for more writings.
I also thought about reading the Input file, then remove all the lines
inside, leaving it empty. But I don't know how to do this...
Thanks again.
Alessandro Noro
Copy the file to another location.
Delete the file
Create the new file for new additions
Do the processing of the file in your code at the new location.
Delete file at new location so you can do the same next time.
--
Get a powerful web, database, application, and email hosting with KJM
Solutions http://www.kjmsolutions.com
"Alessandro" <no***@seait.it> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com... Thanks Larry for your quick reply.
I thought about the solution You suggest me, but unfortunately I cannot do so, because I could delete the Input file only if I could find other files (depending on what I find inside the Input file). Otherwhise I have to wait, and leave the Input file "free" for more writings. I also thought about reading the Input file, then remove all the lines inside, leaving it empty. But I don't know how to do this...
Thanks again. Alessandro Noro
Allessandro
This is an old Jewish witz
Bram asks to the Rabi: "Rabi can God make everything he wants?
The Rabi answers: "Yes of course Bram"
Bram asks: "Rabi can God make a stone which he cannot lift himself?
Your question sounds the same for me.
(I never forget this witz because there is so much true in it).
Cor
"Alessandro" <no***@seait.it> schreef in bericht
news:11**********************@u72g2000cwu.googlegr oups.com... Thanks Larry for your quick reply.
I thought about the solution You suggest me, but unfortunately I cannot do so, because I could delete the Input file only if I could find other files (depending on what I find inside the Input file). Otherwhise I have to wait, and leave the Input file "free" for more writings. I also thought about reading the Input file, then remove all the lines inside, leaving it empty. But I don't know how to do this...
Thanks again. Alessandro Noro This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John Bailo |
last post by:
I'm seeing some odd locking behavior when using an DB2400 database and
running an ado.net transaction. My code -- in simplified form, appears
at the bottom.
I want to run several INSERT...
|
by: Nand Belani |
last post by:
Hi,
I have a MS Access 2000 database on the network, it is secured and the
mdw file is on the network. The database works for most of the users
on the network, but does not open for two of the...
|
by: Chris |
last post by:
Hi,
All my websites and webservices are down. I get the following message
Server Error in '/mywebservices' Application....
|
by: AVL |
last post by:
Hi,
I need some info on text and xml files......
How many users can simultaneously read a text or xml file...
I've a web appliaction which needs to access a text file and a xml file..
The...
|
by: Peter |
last post by:
Hi,everybody,
I will edit a text file and another user maybe read it via LAN at any time.
I want to lock the text file(no reading and writing) while I am editting.
Anyone can help me?
Thanks...
|
by: pgdown |
last post by:
Hi,
I have several processes accessing files from one folder, but only
one process should ever access each file. Once one process has the
file, no other process should be allowed to access it,...
|
by: RLN |
last post by:
RE: Access 2003
My users have an .MDE as their front end.
With this .mde they can still get to the container, double click a
table, and modify data on the back end.
What is the best way to...
|
by: macneed |
last post by:
Can i lock a file in c#,
that i can move it and del it,
but other program don't have right to access(read) until i release it?
i read fileshare.none, but can't delete it without close the...
|
by: zmickle |
last post by:
Excuse my noobness. I am managing an access database that is shared
by 4 users. Management does not want to use any technologies outside
of access for this application (no SQL Server, etc). I...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| | |