What is Temp-File scheme used during backup or sync?


TheMystic

Well-known member
Power User
VIP
Local time
1:00 AM
Posts
752
OS
Windows 11
Hello community!

I use 3rd party apps to backup files from my mobile devices to my laptop.

For this, I sign in with a user account that is setup in Windows only for this purpose.

Now this account is only allowed the following permissions:

20211119_151454.png

I prefer not to allow 'Modify' permission to block these 3rd party apps from other devices from (accidentally or otherwise) deleting files on my laptop.

By default, all 3rd party apps use 'Temp-File' scheme to backup files, which in my understanding allows them to create a temp file during the file transfer process, and once the transfer is complete, the temp file is deleted. So for them to use this method, the target (or destination) directory should allow for 'Modify' permission (something I don't want to give). If this permission is not available, one has to disable the use of 'temp-file' scheme and instead use 'write directly to target folder' method.

1. Why do apps use the 'temp-file' method by default? Does it make file transfers more reliable and faster?
2. What are the disadvantages of using the 'write directly to target folder' method? Does this increase the chance of files getting corrupt during the transfer?


Thanks.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP Envy dv7
    CPU
    Intel Core i7 3630QM
    Motherboard
    HP
    Memory
    16 GB
    Graphics Card(s)
    Intel HD Graphics 4000 & Nvidia GeForce GT 635M
    Sound Card
    IDT High Definition
    Screen Resolution
    1080p
    Hard Drives
    1 TB Crucial MX500 on bay 1.
    1 TB Seagate HDD on bay 2.
    Antivirus
    Windows Defender
The temp file method has been used in computing for many years, probably since backups were first used. It is also used by the OS itself for a file move

What it allows for in for the backup software is that they can safely test the file for accurate copying without risk of damage to the original
the system will make a local copy, compare to the original and then move/copy the copy to the backup media.

With a general move operation the system makes a copy of the original and moves that to the new location and compares the copy with the original - only when this is complete without errors is the original deleted

In windows the temp file will often be renamed by adding a special character to the base filename Eg the file "File1.txt" will be copied to the temp file "$File1$.txt - you can sometimes find this type of file on a disk after a glitch occurs with the process
 

My Computers

System One System Two

  • OS
    Windows 11 Pro x64 [Latest Release Preview] [Win11 PRO HighEnd MUP-00005 DD]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Scan 3XS to my design
    CPU
    AMD RYZEN 9 7950X OEM
    Motherboard
    *3XS*ASUS TUF B650 PLUS WIFI
    Memory
    64GB [2x32GB Corsair Vengeance 560 AMD DDR5]
    Graphics Card(s)
    3XS* ASUS DUAL RTX 4060 OC 8G
    Sound Card
    On motherboard Feeding SPDiF 5.1 system [plus local sound to each monitor]
    Monitor(s) Displays
    32" UHD 32 Bit HDR Monitor + 43" UHD 4K 32Bit HDR TV
    Screen Resolution
    2 x 3840 x 2160
    Hard Drives
    3XS Samsung 980Pro 2TB M.2 PCIe4 4 x 8TB Data + Various Externals from 1TB to 8TB, 10TB NAS
    PSU
    3XS Corsair RM850x 850w Fully Modular
    Case
    FDesign Define 7 XL BK TGL Case - Black
    Cooling
    3XS iCUE H150i ELITE Liquid Cool, Quiet Case fans
    Keyboard
    Wireless Logitec MX Keys + K830 [Depending on where I'm Sat]
    Mouse
    Wireless Logitec - MX Master 3S +
    Internet Speed
    950 MB Down 55 MB Up
    Browser
    Latest Chrome
    Antivirus
    BitDefender Total Security [Latest]
    Other Info
    Also run...
    Dell XPS 17 Laptop
    HP Laptop 8GB - Windows 10 Pro x64 HP 15.2"
    Nexus 7 Android tablet [x2]
    Samsung 10.2" tablet
    Blackview 10.2 Tablet
    Sony Z3 Android Smartphone
    Samsung S9 Plus Smartphone
    Wacom Pro Medium Pen Pad
    Wacom Pro Small Pen Pad
    Wacom ExpressKey Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control Pad
  • Operating System
    Windows 11 Pro x64 [Latest release]
    Computer type
    Laptop
    Manufacturer/Model
    Dell XPS 17 9700
    CPU
    i7 10750H
    Motherboard
    Stock
    Memory
    32 GB
    Graphics card(s)
    Stock Intel + GTX 1650 Ti
    Sound Card
    Stock 4 speaker
    Monitor(s) Displays
    Stock 17" + 32" 4K 3840 x 2160 HDR-10
    Screen Resolution
    3840 x 2400 HDR touchscreen
    Hard Drives
    2TB M2 NVMe
    PSU
    Stock
    Case
    Stock Aluminium / Carbon Fibre
    Cooling
    Stock + 2 fan cooling pad
    Mouse
    Stock Trackpad +Logi Mx Master 3 or MX Ergo Trackball
    Keyboard
    Stock Illuminated + Logi - MX Keys
    Internet Speed
    950 MB Down 55 MB Up
    Browser
    Latest Chrome
    Antivirus
    BitDefender Total Security 2021
    Other Info
    Also use an Adjustable Support for Laptop and Adjustable stand for monitor
The temp file method has been used in computing for many years, probably since backups were first used. It is also used by the OS itself for a file move

What it allows for in for the backup software is that they can safely test the file for accurate copying without risk of damage to the original
the system will make a local copy, compare to the original and then move/copy the copy to the backup media.

With a general move operation the system makes a copy of the original and moves that to the new location and compares the copy with the original - only when this is complete without errors is the original deleted

In windows the temp file will often be renamed by adding a special character to the base filename Eg the file "File1.txt" will be copied to the tamp file "$File1$.txt - you can sometimes find this type of file on a disk after a glitch occurs with the process
A backup operation is essentially just a copy operation (unless the user sets it to delete source files after copying), so is there still a risk of damage to source files?

I see that the apps can still backup my files in the mobile devices to my laptop without the 'Modify' permission. But I am not sure about the disadvantages of using this method.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP Envy dv7
    CPU
    Intel Core i7 3630QM
    Motherboard
    HP
    Memory
    16 GB
    Graphics Card(s)
    Intel HD Graphics 4000 & Nvidia GeForce GT 635M
    Sound Card
    IDT High Definition
    Screen Resolution
    1080p
    Hard Drives
    1 TB Crucial MX500 on bay 1.
    1 TB Seagate HDD on bay 2.
    Antivirus
    Windows Defender
It's always been better policy to work on a copy rather than the original, whilst modern hardware is more reliable and is therefore less likely to cause corruption, it's still safer to use the temp file option

This is doubly important when there is either compression or encryption, or both involved
 

My Computers

System One System Two

  • OS
    Windows 11 Pro x64 [Latest Release Preview] [Win11 PRO HighEnd MUP-00005 DD]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Scan 3XS to my design
    CPU
    AMD RYZEN 9 7950X OEM
    Motherboard
    *3XS*ASUS TUF B650 PLUS WIFI
    Memory
    64GB [2x32GB Corsair Vengeance 560 AMD DDR5]
    Graphics Card(s)
    3XS* ASUS DUAL RTX 4060 OC 8G
    Sound Card
    On motherboard Feeding SPDiF 5.1 system [plus local sound to each monitor]
    Monitor(s) Displays
    32" UHD 32 Bit HDR Monitor + 43" UHD 4K 32Bit HDR TV
    Screen Resolution
    2 x 3840 x 2160
    Hard Drives
    3XS Samsung 980Pro 2TB M.2 PCIe4 4 x 8TB Data + Various Externals from 1TB to 8TB, 10TB NAS
    PSU
    3XS Corsair RM850x 850w Fully Modular
    Case
    FDesign Define 7 XL BK TGL Case - Black
    Cooling
    3XS iCUE H150i ELITE Liquid Cool, Quiet Case fans
    Keyboard
    Wireless Logitec MX Keys + K830 [Depending on where I'm Sat]
    Mouse
    Wireless Logitec - MX Master 3S +
    Internet Speed
    950 MB Down 55 MB Up
    Browser
    Latest Chrome
    Antivirus
    BitDefender Total Security [Latest]
    Other Info
    Also run...
    Dell XPS 17 Laptop
    HP Laptop 8GB - Windows 10 Pro x64 HP 15.2"
    Nexus 7 Android tablet [x2]
    Samsung 10.2" tablet
    Blackview 10.2 Tablet
    Sony Z3 Android Smartphone
    Samsung S9 Plus Smartphone
    Wacom Pro Medium Pen Pad
    Wacom Pro Small Pen Pad
    Wacom ExpressKey Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control Pad
  • Operating System
    Windows 11 Pro x64 [Latest release]
    Computer type
    Laptop
    Manufacturer/Model
    Dell XPS 17 9700
    CPU
    i7 10750H
    Motherboard
    Stock
    Memory
    32 GB
    Graphics card(s)
    Stock Intel + GTX 1650 Ti
    Sound Card
    Stock 4 speaker
    Monitor(s) Displays
    Stock 17" + 32" 4K 3840 x 2160 HDR-10
    Screen Resolution
    3840 x 2400 HDR touchscreen
    Hard Drives
    2TB M2 NVMe
    PSU
    Stock
    Case
    Stock Aluminium / Carbon Fibre
    Cooling
    Stock + 2 fan cooling pad
    Mouse
    Stock Trackpad +Logi Mx Master 3 or MX Ergo Trackball
    Keyboard
    Stock Illuminated + Logi - MX Keys
    Internet Speed
    950 MB Down 55 MB Up
    Browser
    Latest Chrome
    Antivirus
    BitDefender Total Security 2021
    Other Info
    Also use an Adjustable Support for Laptop and Adjustable stand for monitor
It's always been better policy to work on a copy rather than the original, whilst modern hardware is more reliable and is therefore less likely to cause corruption, it's still safer to use the temp file option

This is doubly important when there is either compression or encryption, or both involved
In my case, the temp file is created in the destination folder, not local. Also, it is a simple copy operation which does not involve deleting the source files (like in a normal backup operation).

But now after I removed the 'Modify' permission from the destination folder and changed the backup operation to 'write directly to target' option, I don't see the temp file getting created in the destination folder. The source files are still backed up to the destination without errors.

Whether the app will use 'temp-file' scheme or not depends on the permissions for the destination folder. In my case since I have denied 'Modify' permission, it can't use the temp-file scheme since it won't be able to delete the temp file after the backup operation is complete.

From what you say, the app should still be able to create a local copy (in the source folder) which will then be copied/ moved to the destination, before the newly created copy in the source folder is deleted. This is not what is happening with the temp-file scheme.

Since by default all apps use the 'temp-file' scheme (where the temp file is created in the destination folder), I believe there should be some advantage to it over writing directly to the target. But it is not clear what that is.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP Envy dv7
    CPU
    Intel Core i7 3630QM
    Motherboard
    HP
    Memory
    16 GB
    Graphics Card(s)
    Intel HD Graphics 4000 & Nvidia GeForce GT 635M
    Sound Card
    IDT High Definition
    Screen Resolution
    1080p
    Hard Drives
    1 TB Crucial MX500 on bay 1.
    1 TB Seagate HDD on bay 2.
    Antivirus
    Windows Defender
The only time that the Temp file becomes important is when the system has an issue that causes the direct file write to fail, this would be a small risk with modern hardware as long as you are happy with the risk that's fine
 

My Computers

System One System Two

  • OS
    Windows 11 Pro x64 [Latest Release Preview] [Win11 PRO HighEnd MUP-00005 DD]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Scan 3XS to my design
    CPU
    AMD RYZEN 9 7950X OEM
    Motherboard
    *3XS*ASUS TUF B650 PLUS WIFI
    Memory
    64GB [2x32GB Corsair Vengeance 560 AMD DDR5]
    Graphics Card(s)
    3XS* ASUS DUAL RTX 4060 OC 8G
    Sound Card
    On motherboard Feeding SPDiF 5.1 system [plus local sound to each monitor]
    Monitor(s) Displays
    32" UHD 32 Bit HDR Monitor + 43" UHD 4K 32Bit HDR TV
    Screen Resolution
    2 x 3840 x 2160
    Hard Drives
    3XS Samsung 980Pro 2TB M.2 PCIe4 4 x 8TB Data + Various Externals from 1TB to 8TB, 10TB NAS
    PSU
    3XS Corsair RM850x 850w Fully Modular
    Case
    FDesign Define 7 XL BK TGL Case - Black
    Cooling
    3XS iCUE H150i ELITE Liquid Cool, Quiet Case fans
    Keyboard
    Wireless Logitec MX Keys + K830 [Depending on where I'm Sat]
    Mouse
    Wireless Logitec - MX Master 3S +
    Internet Speed
    950 MB Down 55 MB Up
    Browser
    Latest Chrome
    Antivirus
    BitDefender Total Security [Latest]
    Other Info
    Also run...
    Dell XPS 17 Laptop
    HP Laptop 8GB - Windows 10 Pro x64 HP 15.2"
    Nexus 7 Android tablet [x2]
    Samsung 10.2" tablet
    Blackview 10.2 Tablet
    Sony Z3 Android Smartphone
    Samsung S9 Plus Smartphone
    Wacom Pro Medium Pen Pad
    Wacom Pro Small Pen Pad
    Wacom ExpressKey Remote
    Loopdeck+ Graphics Controller
    Shuttle Pro v2 Control Pad
  • Operating System
    Windows 11 Pro x64 [Latest release]
    Computer type
    Laptop
    Manufacturer/Model
    Dell XPS 17 9700
    CPU
    i7 10750H
    Motherboard
    Stock
    Memory
    32 GB
    Graphics card(s)
    Stock Intel + GTX 1650 Ti
    Sound Card
    Stock 4 speaker
    Monitor(s) Displays
    Stock 17" + 32" 4K 3840 x 2160 HDR-10
    Screen Resolution
    3840 x 2400 HDR touchscreen
    Hard Drives
    2TB M2 NVMe
    PSU
    Stock
    Case
    Stock Aluminium / Carbon Fibre
    Cooling
    Stock + 2 fan cooling pad
    Mouse
    Stock Trackpad +Logi Mx Master 3 or MX Ergo Trackball
    Keyboard
    Stock Illuminated + Logi - MX Keys
    Internet Speed
    950 MB Down 55 MB Up
    Browser
    Latest Chrome
    Antivirus
    BitDefender Total Security 2021
    Other Info
    Also use an Adjustable Support for Laptop and Adjustable stand for monitor

Latest Support Threads

Back
Top Bottom