|
Packit Service |
a2489d |
/*
|
|
Packit Service |
a2489d |
* lftp - file transfer program
|
|
Packit Service |
a2489d |
*
|
|
Packit Service |
a2489d |
* Copyright (c) 1996-2012 by Alexander V. Lukyanov (lav@yars.free.net)
|
|
Packit Service |
a2489d |
*
|
|
Packit Service |
a2489d |
* This program is free software; you can redistribute it and/or modify
|
|
Packit Service |
a2489d |
* it under the terms of the GNU General Public License as published by
|
|
Packit Service |
a2489d |
* the Free Software Foundation; either version 3 of the License, or
|
|
Packit Service |
a2489d |
* (at your option) any later version.
|
|
Packit Service |
a2489d |
*
|
|
Packit Service |
a2489d |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
a2489d |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
a2489d |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
a2489d |
* GNU General Public License for more details.
|
|
Packit Service |
a2489d |
*
|
|
Packit Service |
a2489d |
* You should have received a copy of the GNU General Public License
|
|
Packit Service |
a2489d |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit Service |
a2489d |
*/
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
#ifndef CHMODJOB_H
|
|
Packit Service |
a2489d |
#define CHMODJOB_H
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
#include "TreatFileJob.h"
|
|
Packit Service |
a2489d |
#include "FileSet.h"
|
|
Packit Service |
a2489d |
CDECL_BEGIN
|
|
Packit Service |
a2489d |
#include "modechange.h"
|
|
Packit Service |
a2489d |
CDECL_END
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
class ChmodJob : public TreatFileJob
|
|
Packit Service |
a2489d |
{
|
|
Packit Service |
a2489d |
public:
|
|
Packit Service |
a2489d |
enum verbosity { V_NONE, V_CHANGES, V_ALL };
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
private:
|
|
Packit Service |
a2489d |
void TreatCurrent(const char *d,const FileInfo *fi);
|
|
Packit Service |
a2489d |
void CurrentFinished(const char *d,const FileInfo *fi);
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
void Init();
|
|
Packit Service |
a2489d |
void Report(const char *d,const FileInfo *fi, bool success);
|
|
Packit Service |
a2489d |
bool RelativeMode(const mode_change *m) const;
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
verbosity verbose;
|
|
Packit Service |
a2489d |
mode_change *m;
|
|
Packit Service |
a2489d |
int simple_mode;
|
|
Packit Service |
a2489d |
int GetMode(const FileInfo *fi) const;
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
public:
|
|
Packit Service |
a2489d |
/* if you use this constructor, also set a mode with SetMode() */
|
|
Packit Service |
a2489d |
ChmodJob(FileAccess *s,ArgV *a);
|
|
Packit Service |
a2489d |
/* simple "chmod 123" interface: */
|
|
Packit Service |
a2489d |
ChmodJob(FileAccess *s,int m,ArgV *a);
|
|
Packit Service |
a2489d |
~ChmodJob();
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
void SetVerbosity(verbosity v);
|
|
Packit Service |
a2489d |
void SetMode(mode_change *newm);
|
|
Packit Service |
a2489d |
void Recurse();
|
|
Packit Service |
a2489d |
};
|
|
Packit Service |
a2489d |
|
|
Packit Service |
a2489d |
#endif//CHMODJOB_H
|