Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > File Transfer
  New Posts New Posts RSS Feed - Determine if a Window file (Excel) is opened?
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedDetermine if a Window file (Excel) is opened?

 Post Reply Post Reply
Author
Message
mikehmc View Drop Down
Groupie
Groupie


Joined: June 17 2004
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikehmc Quote  Post ReplyReply Direct Link To This Post Topic: Determine if a Window file (Excel) is opened?
    Posted: August 06 2013 at 11:26am
I am writing to windows, then opening the file using the external program execution. ESC STX < command CR
Works Great to write a PO to windows, and open.

But I would like to delete the record if po.entry wants to modify the PO. How can I tell if a user has the file open. I have tried reading with the locked clause and do not get a lock.

however, 'delete file,id' does lock. so I need to be able to deal with a lock and proceed or fail. dropping into debugger results in below.

I lk.fail:188
unable to lock item '302016.CSV' in group 5309865; locked by line 65535
!
Would like to be able to determine if windows file open.
thanks
Back to Top
Shrek59 View Drop Down
Senior Member
Senior Member


Joined: December 04 2006
Location: New Zealand
Status: Offline
Points: 208
Post Options Post Options   Thanks (0) Thanks(0)   Quote Shrek59 Quote  Post ReplyReply Direct Link To This Post Posted: August 11 2013 at 8:53am
This is actually a generic Windows issue rather than an AccuTerm issue. Try looking at this answer for some ideas:

http://stackoverflow.com/questions/1951791/how-to-check-if-a-file-is-already-open-by-another-process-in-c

One of the answers here suggests use of the SysInternals handle utility to determine if the file is open. That will require you to execute the utility from Pick/Basic and then parse the result.  Check here for that utility:

http://technet.microsoft.com/en-us/sysinternals/bb896655

HTH,

Brian.
Back to Top
Stefano View Drop Down
Newbie
Newbie


Joined: October 24 2005
Location: Italy
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stefano Quote  Post ReplyReply Direct Link To This Post Posted: August 12 2013 at 10:16am
Check "File Status" by Tony Gravagno @
http://nebula-rnd.com/freeware/
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.