Check Whether File is Read Only using Macros

Help with writing and playing macros

Check Whether File is Read Only using Macros

Postby prashanth7582 » Tue Jun 17, 2008 9:09 pm

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!!
User avatar
prashanth7582
Newbie
 
Posts: 9
Joined: Fri Jul 20, 2007 11:00 pm

Re: Check Whether File is Read Only using Macros

Postby Mofi » Wed Jun 18, 2008 2:24 am

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros