PDA

View Full Version : file.setattributes for variable file location


Memontgo
08-10-2005, 07:01 PM
Newbie here,

I've searched but haven't found the answer. I'm having my users select the folder that they want to copy a file to using dialog.folderbrowse. Then copying the file using file.copy. I then need to change the readonly attribute after it is on their system. Can I use the result from dialog.folderbrowse in conjunction with the filename to locate the file? Please give me a sample of the code as I've tried several things without any luck. Here is what I have so far;

result = Dialog.FolderBrowse("Please select a folder:", "{_SourceFolder}");
StatusDlg.Show(MB_ICONNONE, false);
File.Copy("AutoPlay\\Docs\\IIDD_W_Text.ppt", result, true, true, false, true, nil);
StatusDlg.Hide();
File.SetAttributes("??????", {ReadOnly=True});

Thanks!!

Derek
08-10-2005, 07:41 PM
Hi

What you have will work - just the last line that needs adjusting.
Notice also, that ReadOnly=true and not True

File.SetAttributes(result.."\\IIDD_W_Text.ppt", {ReadOnly=true});

Hope that helps :)

Memontgo
08-10-2005, 11:15 PM
Exactly what I was looking for. I knew I could use the result variable again, just couldn't get the right combination. Thanks :p