Gestiti i files che possono essere comuni nel cambio ditta
git-svn-id: svn://10.65.10.50/trunk@543 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fc011addc8
commit
4b6762a947
@ -37,7 +37,7 @@ TPrefix::~TPrefix()
|
||||
}
|
||||
|
||||
|
||||
HIDDEN int closeall(bool changestudy, TBit_array& excl)
|
||||
HIDDEN int closeall(bool changestudy, TBit_array& excl, TBit_array& toclose)
|
||||
|
||||
{
|
||||
if (!openf) return 0;
|
||||
@ -52,7 +52,7 @@ HIDDEN int closeall(bool changestudy, TBit_array& excl)
|
||||
{
|
||||
isfdptr isfd = openf[i];
|
||||
d.get(i + 1, _nolock, _nordir, _sysdirop);
|
||||
if (changestudy || d.name()[0] != '%')
|
||||
if (toclose[i + 1] || changestudy || d.name()[0] != '%')
|
||||
{
|
||||
excl.set(i, isfd->f.LockMode == _excllock);
|
||||
CClose(&isfd->f);
|
||||
@ -64,7 +64,7 @@ HIDDEN int closeall(bool changestudy, TBit_array& excl)
|
||||
}
|
||||
|
||||
|
||||
HIDDEN void openall(bool changestudy, TBit_array& excl, int oldmax)
|
||||
HIDDEN void openall(bool changestudy, TBit_array& excl, int oldmax, TBit_array& toopen)
|
||||
|
||||
{
|
||||
if (!openf) return ;
|
||||
@ -87,7 +87,7 @@ HIDDEN void openall(bool changestudy, TBit_array& excl, int oldmax)
|
||||
{
|
||||
isfdptr isfd = openf[i];
|
||||
d.get(i + 1, _nolock, _nordir, _sysdirop);
|
||||
if (changestudy || d.name()[0] != '%')
|
||||
if (toopen[i + 1] || changestudy || d.name()[0] != '%')
|
||||
{
|
||||
isfd->ft = d.name()[0] == '%' ? _comdir : _nordir;
|
||||
d.get(i + 1, _nolock, (TDirtype) isfd->ft);
|
||||
@ -123,12 +123,16 @@ void TPrefix::set(const char* name, bool force, TFilelock mode)
|
||||
|
||||
if (!force && !test(name)) return;
|
||||
|
||||
TBit_array excl;
|
||||
TBit_array excl, comfiles;
|
||||
int max = 0;
|
||||
comfiles.set(LF_PCON);
|
||||
comfiles.set(LF_CLIFO);
|
||||
comfiles.set(LF_CAUSALI);
|
||||
comfiles.set(LF_RCAUSALI);
|
||||
|
||||
if (_prefix != ".")
|
||||
{
|
||||
max = closeall(FALSE, excl);
|
||||
max = closeall(FALSE, excl, comfiles);
|
||||
CCloseDir(NORDIR);
|
||||
CCloseDir(COMDIR);
|
||||
CCloseRecDir(NORDIR);
|
||||
@ -163,7 +167,7 @@ void TPrefix::set(const char* name, bool force, TFilelock mode)
|
||||
|
||||
CGetFile(LF_DIR, &d, _nolock, NORDIR);
|
||||
_filelevel = d.Flags;
|
||||
openall(FALSE, excl, max);
|
||||
openall(FALSE, excl, max, comfiles);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user