Author Topic: vl-file-systime returns nil  (Read 1867 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7529
vl-file-systime returns nil
« on: January 08, 2010, 02:06:21 PM »
Does anyone know why this function returns nil on some files? I've checked that the files are not open but it still returns nil?

I've even tried using the file system object like so but it throws an exception  :?

Code: [Select]
  (defun rjp-getfileobj (file / sfso out)
    (if (and (setq sfso (vlax-create-object "Scripting.FileSystemObject"))
     (setq out (vl-catch-all-apply 'vlax-invoke (list sfso 'getfile file)))
     (not (vl-catch-all-error-p out))
)
      out
    )
  )
  (defun getmod (file) (vlax-get file 'datelastmodified))

(setq files (mapcar 'getmod (vl-remove 'nil (mapcar 'rjp-getfileobj files))))

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: vl-file-systime returns nil
« Reply #1 on: January 08, 2010, 02:20:14 PM »
No clue if not open.
Have you tried this one?
(dos_filedate path)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: vl-file-systime returns nil
« Reply #2 on: January 08, 2010, 04:36:37 PM »
No clue if not open.
Have you tried this one?
(dos_filedate path)

I just tried dos_filedate and it returns nil as well... I'm stumped  :?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: vl-file-systime returns nil
« Reply #3 on: January 08, 2010, 07:02:50 PM »
You say the file is not open but is is locked by another user? Grabbing at straws. :?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.