Talk:Sync

From LQWiki
Jump to navigation Jump to search

I have a bash script that does the following:

  • copy a file from a CD to a directory
  • run the file from the directory
  • delete the file
  • eject the CD

The idea is that once it's running in memory, we don't need it on disk any more.

However, every time we do this, we can't eject the CD. lsof reveals that the CD is tied to the running instance of the file.

We tried using sync to get the file to run from the directory, rather than the CD. (running snyc immediately after the copy)

However, it still runs from the CD, according to lsof.

We tried issuing a sleep command after the sync, in the hope that maybe the kernel was deferring execution. 2 seconds ought to be enough, right?

But even that doesn't work.

Does anyone know what's wrong here?

-- [[User:LionKimbro|LionKimbro]

If you give us the script, that'd help. Though I don't think the wiki is the place for this. If you have a technical problem, you'd probably best use the forums. Dysprosia 05:29, Aug 12, 2004 (EDT)