Hi ,
What I am trying to do is create a file and set the permissions to
OwnerRead=true
OwnerWrite=true;
OwnerExecute=true;
GroupRead=true;
GroupExecute=true;
OthersExecute=ture;
OthersRead=True;
This is for Linux
how can I do this at runtime while creating the file.
Thanks
From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: TStringList.SaveToFile File
permissionsDate: Fri, 7 Dec 2007 13:05:34 -0700
If you are on a windows system, then this is not a problem.
On a Linux system, the permissions will be set when the file is saved. Owner
of the file will have R/W while all other should have read only unless your
system administrator has other definitions on how that is defined.
The user saving the file will only be able to save that file into an area in
which they have permission to write.
Jeff
----- Original Message -----
From: el stamatakos
To: Jeff Steinkamp
Sent: Friday, December 07, 2007 12:17
Subject: TStringList.SaveToFile File permissions
Hi All, I have a TStringList that I add lines to and eventually use the
SaveToFile to Create the file with all the lines of my StringList in it. How do
I set the permissions for this file that was created using SaveToFile from a
TStringList. Thanks Lefti
From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: [lazarus] ShellApi available in
Lazarus?Date: Fri, 7 Dec 2007 11:20:04 -0700
Lefti
I use Create Process. Here is a fucntion I use to do that. Make sure you add
process to the uses clause of the unit.
app -- complete path to the application you want to execute
cmd -- amy command line arguments you whish to add
Wait -- Set to true if you want the procedure to wait for the process to finish.
procedure TForm1.ExecNewProcess(app,cmd: string; Wait: Boolean);var AProcess:
TProcess;
// This is where our program starts to runbegin // Now we will create the
TProcess object, and // assign it to the var AProcess. AProcess :=
TProcess.Create(nil);
try Aprocess.ShowWindow := swoShowNormal;
// Tell the new AProcess what the command to execute is. // Let's use the
FreePascal compiler if cmd <> '' then AProcess.CommandLine := app + ' "'
+ cmd +'"' else AProcess.CommandLine := app;
// We will define an option for when the program // is run. This option
will make sure that our program // does not continue until the program we
will launch // has stopped running. vvvvvvvvvvvvvv if wait =
True then
AProcess.Options := AProcess.Options + [poWaitOnExit];
// Now that AProcess knows what the commandline is // we will run it.
AProcess.Execute;
// This is not reached until app stops running.
finally AProcess.Free;
end;
end;
----- Original Message -----
From: el stamatakos
To: Jeff Steinkamp ; [email protected]
Sent: Friday, December 07, 2007 10:51
Subject: RE: [lazarus] ShellApi available in Lazarus?
Hi Jeff, I would like to be able to call other programs so I usually would use
the ShellExecute command. How is this done on Lazarus for Linux. Thanks Lefti>
From: [EMAIL PROTECTED]> To: [email protected]> Subject: Re: [lazarus]
ShellApi available in Lazarus?> Date: Fri, 7 Dec 2007 00:08:24 -0700> > > -----
Original Message ----- > From: el stamatakos> To: [email protected] ; [EMAIL
PROTECTED]> Sent: Thursday, December 06, 2007 17:02> Subject: RE: [lazarus]
ShellApi available in Lazarus?> > > > Hi John> Would this work undre Linux?> >
Thanks> > Lefti> > > > > Date: Fri, 7 Dec 2007 10:32:47 +1100> From: [EMAIL
PROTECTED]> To: [email protected]> Subject: Re: [lazarus] ShellApi available
in Lazarus?> > el stamatakos wrote:> Hi All,> is the ShellApi available in
Lazarus? When I add it into my uses > ShellApi it comes back with an error
cannot find unit ShellApi.> > Thanks> > Lefti> > See if what you want is in the
windows unit.> > cheers,> John> ---------------------------------> > The shell
commands are windows only and will be found in the windows > unit. I would
recommend using the TProcess which should work for both > Linux and Windows.> >
Jeff> > > _________________________________________________________________> To
unsubscribe: mail [EMAIL PROTECTED] with> "unsubscribe" as the Subject>
archives at http://www.lazarus.freepascal.org/mailarchives