What's the meaning of bit 1 and 2 of the copyflags number?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
white
Power Member
Power Member
Posts: 5970
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

What's the meaning of bit 1 and 2 of the copyflags number?

Post by *white »

I made the following table.

Code: Select all

copyflags:number

copy options are stored in the bits of the copyflags number
bit value 1 = option is enabled
bit value 0 = option is disabled

1111111111111111111111111111
||||||||||||||||||||||||||||_______ 1      delete read only files (e.g. when moving to different drive)
|||||||||||||||||||||||||||________ 2      delete hidden/system files (e.g. when moving to different drive)
||||||||||||||||||||||||||_________ 4 [A ] overwrite all
|||||||||||||||||||||||||__________ 8 [A ] skip all (never overwrite)
||||||||||||||||||||||||__________ 16 [A ] overwrite all older
|||||||||||||||||||||||___________ 32      overwrite read only files
||||||||||||||||||||||____________ 64      overwrite hidden/system files
|||||||||||||||||||||____________ 128      skip all which cannot be opened for reading
||||||||||||||||||||_____________ 256 [A ] auto-rename copy of source file
|||||||||||||||||||______________ 512 [A ] auto-rename existing target files
||||||||||||||||||______________ 1024 [A ] overwrite all older and with the same date/time
|||||||||||||||||_______________ 2048 [A ] copy all larger files (overwrite smaller)
||||||||||||||||________________ 4096 [A ] copy all smaller files (overwrite larger)
|||||||||||||||_________________ 8192      copy all with name length >259
||||||||||||||_________________ 16384      skip all with name length >259
|||||||||||||__________________ 32768      advanced options hidden in copy dialog (only process flags marked with B)
||||||||||||___________________ 65536      skip if read error
|||||||||||___________________ 131072      skip if write error
||||||||||____________________ 262144      copy/delete all as Administrator if access is denied
|||||||||_____________________ 524288      copy to all selected target folders/links
|||||||||_____________________ 524288      name too long already confirmed in failed rename 
||||||||_____________________ 1048576 [ B] copy NTFS permissions
|||||||______________________ 2097152      convert unicode chars from other codepage to underscores
||||||_______________________ 4194304      skip all files with unicode chars from other codepage
|||||________________________ 8388608      rename each file separately
||||________________________ 16777216      skip all when copying as Administrator
|||_________________________ 33554432      keep relative paths when copying in branch view
||__________________________ 67108864 [ B] verify after copy
|__________________________ 134217728 [ B] ignore CRC errors in verify after copy

A = mutually exclusive flags
B = if advanced options are hidden in copy dialog, only process flags marked with B
It seems that setting bit 1 and 2 is not necessary. What's the meaning of those bits? (*table updated after answer*)
Last edited by white on 2013-10-01, 21:43 UTC, edited 4 times in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Here are the constants from my source code:

Code: Select all

  cdf_clearreadonly=1;             // delete all read only files (e.g. when moving)
  cdf_clearhidsys=2;               // delete all hidden/system files
  cdf_copywithoutask=4;            // overwrite all
  cdf_SkipAll=8;                   // skip all
  cdf_CopyAllNewer=16;             // overwrite older
  cdf_overwritereadonly=32;        // overwrite all read only files
  cdf_overwritehidsys=64;          // overwrite all hidden/system files
  cdf_SourceSkipAll=128;           // skip all unreadable source files (cannot open)
  cdf_autorename=256;              // auto-rename copied files
  cdf_autorenametarget=512;        // auto-rename target files
  cdf_CopyAllNewerAndEqual=1024;   // copy all with newer or same date/time
  cdf_CopyAllLarger=2048;          // copy all larger files
  cdf_CopyAllSmaller=4096;         // copy all smaller files
  cdf_CopyAllTooLong=8192;         // copy all with name length >259
  cdf_SkipAllTooLong=16384;        // skip all with name length >259
  cdf_unchanged=32768;             // user didn't use "options" in F5 dialog
  cdf_SkipAllReadError=$10000;     // Skip all on read error
  cdf_SkipAllWriteError=$20000;    // Skip all on write error
  cdf_AllAsAdmin=$40000;           // Copy/Delete all as admin
  cdf_TooLongAlreadyConfirmedRename=$80000; // Name too long already confirmed in failed rename
  cdf_CopyToAllTargets=$80000;     // Copy to all selected target folders+links
  cdf_CopyPermissionsBG=$100000;   // Tells background transfer manager to copy permissions
  cdf_AutorenameUnicode=$200000;   // Convert Unicode chars from other codepage to underscores
  cdf_SkipAllUnicode=$400000;      // Skip all files with Unicode chars from other codepage
  cdf_AlwaysAskRenameUnicode=$800000; // Rename each file separately
  cdf_SkipAllAsAdmin=$1000000;     // Skip all when copying as admin
  cdf_KeepRelativePaths=$2000000;  // Keep relative paths when copying in branch view
  cdf_Verify=$4000000;             // Verify files after copying
  cdf_SkipAllVerify=$8000000;      // Do not show CRC errors when user chooses "Skip all" in CRC error dialog
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5970
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Thank you very much!
User avatar
white
Power Member
Power Member
Posts: 5970
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:Here are the constants from my source code:

Code: Select all

  cdf_TooLongAlreadyConfirmedRename=$80000; // Name too long already confirmed in failed rename
  cdf_CopyToAllTargets=$80000;     // Copy to all selected target folders+links
These constants have the same value. Are they both used in copyflags?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, because they are used in different places.
Author of Total Commander
https://www.ghisler.com
Post Reply