Page 1 of 1 1
Topic Options
#157413 - 2006-02-17 05:04 PM Test for locked files (in use)
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Anyone have a crafty way of testing for files that are in use and therefore locked? I mean besides doing an Open().
Jim came up with a way to exploit a limitation in KiX but Ruud since fixed it.
http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=82796&an=0&page=0#82796

I am trying to backup some files with Jooel's MakeCAB() UDF but it kills the script if it encounters a locked file.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157414 - 2006-02-17 05:31 PM Re: Test for locked files (in use)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
can you copy to a temp dir first?
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#157415 - 2006-02-17 05:41 PM Re: Test for locked files (in use)
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I thought of that but I have maybe 30 meg of files I need to backup quickly. My logon script does not run sync so the desktop comes up before the script is finished and if the user launches Lotus Notes in the Startup, it can throw locks on the files before my script completes.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157416 - 2006-02-17 05:46 PM Re: Test for locked files (in use)
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
ok... how about moving/renaming the file/folder, backing it up and then restoring it
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#157417 - 2006-02-17 06:02 PM Re: Test for locked files (in use)
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I can copy the files that have locks on them but cannot MakeCAB() the same files. I'm guessing MakeCAB wants exclusive and cannot get it.
I would rather not copy that much uncompressed data to the DFS because it has FRS replication and I don't want to trigger that much replication.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157418 - 2006-02-17 06:10 PM Re: Test for locked files (in use)
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I suppose I could copy the files locally to %temp% and then MakeCAB from them there and then delete them from temp.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157419 - 2006-02-17 09:40 PM Re: Test for locked files (in use)
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
You could shell to dos and rename the folder and if you get an error you know it's locked. If not locked it should be able to rename the folder with no problem. Then rename it back to what it was and do your file MakeCAB stuff.
Top
#157420 - 2006-02-18 02:55 PM Re: Test for locked files (in use)
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Sorry doc, that would not do. It would pull the rug out from under the client and really mess things up.
I gave up on the notion of testing locks and decided to copy the files (in use or not) to another local folder and then MakeCAB from those. I then delete the copies. Solves a whole bunch of problems that way.
Still, there may be value in finding a way to easily test if there are files in use for other purposes.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.055 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org