Re: program to copy files - problems - unix ksh to java
From: kaeli (tiny_one_at_NOSPAM.comcast.net)
Date: 02/10/04
- Next message: kaeli: "Re: jsp files not reflecting changes on tomcat"
- Previous message: sqlboy2000: "Re: jsp files not reflecting changes on tomcat"
- In reply to: Harald Kirsch: "Re: program to copy files - problems - unix ksh to java"
- Next in thread: Harald Kirsch: "Re: program to copy files - problems - unix ksh to java"
- Reply: Harald Kirsch: "Re: program to copy files - problems - unix ksh to java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 10 Feb 2004 08:08:11 -0600
In article <16990fa4.0402100125.6467a049@posting.google.com>,
pifpafpuf@gmx.de enlightened us with...
>
> Hard to believe on a *NIX machine as the system allows to delete
> files held open by other processes. It may be a possible problem
> if the file is on NFS. In any case it
> sounds like the first process, when finished, deletes the file,
> while the 2nd copy process, started while the first was still
> running, then gets in trouble and messes things up.
>
That's probably it.
> > Program gets called again while an instance is running, so it tries to
> > copy files that are currently being copied.
>
> A solution might be to rename the file locally *before*
> copying. This way the process starting 5 minutes later will
> not pick up the same file again. If this is not an option,
> create an empty file with another extension than the
> big file as a mark that the file is being worked on.
>
That won't help.
The code copies any files in a directory on one machine to a directory
on another. So it will still grab the file. The code would have to move
the file, which is already the problem.
>
> There is no need to solve this task in Java.
I need threading (I think) because right now, the solution is to not run
two instances of the code at the same time. That is not a good solution.
We need code that runs almost continuously, looking in directories and
copying and deleting the files.
(it's a DMZ, in case that helps you see why this needs to be done - it
takes files people uploaded and moves them to a machine inside our
firewall)
So, as far as I see, I need C or Java, and I've not coded C in over a
year. :)
We want a process that runs pretty much all the time. I'm thinking a
program that looks in directories over and over. When it finds a file,
it starts a thread that copies it then deletes it. As part of the
thread, it can put the name of the file in a vector. Any new threads
check that vector before bothering a file...
I dunno, am I way off on that?
-- -- ~kaeli~ Never say, "Oops!"; always say, "Ah, interesting!" http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace
- Next message: kaeli: "Re: jsp files not reflecting changes on tomcat"
- Previous message: sqlboy2000: "Re: jsp files not reflecting changes on tomcat"
- In reply to: Harald Kirsch: "Re: program to copy files - problems - unix ksh to java"
- Next in thread: Harald Kirsch: "Re: program to copy files - problems - unix ksh to java"
- Reply: Harald Kirsch: "Re: program to copy files - problems - unix ksh to java"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|