Is there any relevance for checking if a file is in use?
Why? I want to be able to have a smaller, known error if a file I am looking at is in use, rather than the extremely long error that currently shows up.
Thanks.
Is there any relevance for checking if a file is in use?
Why? I want to be able to have a smaller, known error if a file I am looking at is in use, rather than the extremely long error that currently shows up.
Thanks.
exists files "path" whose(exists lines of it)
Can you provide more relevance? More context of the particulars?
Of course that wonât show a file in use on Non Windows
That is such a simple, but great solution JG.
Part of the reason for this is aesthetics. In Web Reports if the classIOError gets thrown the columns will resize to be the full width of the error. If the error was short, it would not be as bad.
What I think I am going to do is take your suggestion (right now it is only on Windows) and re-work the logic to include the âexists lines of itâ. Iâll try posting back the results when it is completed.
-c
Canât find my password for the main BigFix.met site, so I am just going to post this here. I will post it over to there in the AM.
if not ( exists file "foo" of folder "bar" of storage folder of client ) then "System Not Evaluated" else if not exists file "foo" whose ( exists lines of it ) of folder "bar" of storage folder of client then "File Not Evaluated" else substrings separated by "|" of (( "Time Stamp: " & ( ( modification time of it ) as string ) ) & "|" & ( concatenation "|" of ( ( following texts of firsts " " of lines of it) as string ) )) of file "foo" of folder "bar" of storage folder of client
Time stamp and contents of file:
You donât need all of that IF/THEN/ELSE unless you really want to provide the helpful text. You can instead do something like this:
substrings separated by "|" of (( "Time Stamp: " & ( ( modification time of it ) as string ) ) & "|" & ( concatenation "|" of ( ( following texts of firsts " " of lines of it) as string ) )) of files "foo" whose ( exists lines of it ) of folders "bar" of storage folders of clients
This will either return <none>
or it will return the expected results, without throwing an error by using plural relevance.
Yea, I had all of the âif/then/elseâ so I could tell why it was erring. This is used as part of an action/analysis setup so I wanted to know if it was failing because the action did not run yet or if the action was running (file was busy).