Author Topic: testing to see if a file is open (write-line)  (Read 1526 times)

0 Members and 1 Guest are viewing this topic.

psuchewinner

  • Guest
testing to see if a file is open (write-line)
« on: July 06, 2010, 03:27:08 PM »
Is there a way to test to see if a file that has been opened?

Example
 (setq f (open "c:\bla-bla.txt" "a"))

How can I tell if it is open?

kpblc

  • Bull Frog
  • Posts: 396
Re: testing to see if a file is open (write-line)
« Reply #1 on: July 06, 2010, 03:33:10 PM »
(vl-file-systime "c:\bla-bla.txt")
Sorry for my English.

efernal

  • Bull Frog
  • Posts: 206
Re: testing to see if a file is open (write-line)
« Reply #2 on: July 06, 2010, 04:31:14 PM »
I allways use this and works...

(IF (SETQ o_file (OPEN file "w"))
(PROGN
....
)
(ALERT "Error on opening file...")
)

e.fernal
e.fernal

psuchewinner

  • Guest
Re: testing to see if a file is open (write-line)
« Reply #3 on: July 07, 2010, 10:25:37 AM »
Thanks e.fernal, that was exactly what I needed!  Im rolling now!

efernal

  • Bull Frog
  • Posts: 206
Re: testing to see if a file is open (write-line)
« Reply #4 on: July 07, 2010, 02:41:45 PM »
glad to help...
e.fernal
e.fernal