Tapatalk

Check Whether File is Read Only using Macros

Check Whether File is Read Only using Macros

9

    Jun 18, 2008#1

    Dear All,

    I need to check whether the file is Read Only or not using macros and send the message accordingly.

    Is that possible using macros?

    Thanks in advance!!

    6,684587
    Grand MasterGrand Master
    6,684587

      Jun 18, 2008#2

      This small code tries to insert a character and if that works, the file is not read-only.

      InsertMode
      Key HOME
      IfColNumGt 1
      Key HOME
      EndIf
      "#"
      IfColNum 2
      Key BACKSPACE
      Else
      // Insert here the commands for a read-only file.
      EndIf

      A solution without temporary modifying the file is not possible directly. You would need a user tool which checks the file attributes of the current file and reports it back to UltraEdit. That user tool could be executed from within a macro. But maybe this solution is already enough.
      Best regards from an UC/UE/UES for Windows user from Austria