Hello
Is there anyway to edit the properties of an external file from Revolution.
For example check a list of files in my hard drive and mark one as read only, or hidden.
Thanks
Andres
File Management
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
You might be able to access such functions using the "shell()" function.
On unix systems (like Mac OS X) you should use the "chmod" shell command to change file permissions. And to make an item invisible you just need to add a period "." as the first character of its name using the "mv" shell command.
Here is an example:
To make a file read only, you can use an AppleScript also if you are on OS X:
To exectue such an AppleScript in Rev, use the "do as OSALanguage" command.
On unix systems (like Mac OS X) you should use the "chmod" shell command to change file permissions. And to make an item invisible you just need to add a period "." as the first character of its name using the "mv" shell command.
Here is an example:
Code: Select all
get shell("mv CoolName .CoolName")
Code: Select all
tell application "Finder"
set the locked of document file "CoolName" of startup disk to true
end tell
Hi Andres,
As far as i'm aware this currently does have to be done using shell commands.
In addition to those options already mentioned, on OS X systems you can use the Unix chmod command and on Windows systems you can use the attrib command. For example to make a file read only on Windows (not tested):
Note that when using shell commands on Windows systems, you will need to convert any file paths to Windows format. This is normally a simple matter of replace forward slashes with backslashes eg:
Hope this helps.
Regards
Oliver[/code]
As far as i'm aware this currently does have to be done using shell commands.
In addition to those options already mentioned, on OS X systems you can use the Unix chmod command and on Windows systems you can use the attrib command. For example to make a file read only on Windows (not tested):
Code: Select all
local tResult, tShellResult
put shell("attrib +R " & quote & tFilename & quote) into tShellResult
put the result into tResult
if tResult is not 0 then
error "Failed to make file readonly: " & tShellResult
end if
Code: Select all
replace "/" with "\" in tFilename
Regards
Oliver[/code]
Oliver Kenyon
Software Developer
Runtime Revolution
Software Developer
Runtime Revolution