Jump to content

what is the "Temporary" file attribute for?


Recommended Posts

googling for days, i find a lot of info about file attributes as a concept, and much concrete info for the commonly used ones (i.e. Hidden, System, Read-only). i find nothing about the Temporary file attribute - it's not even listed in the help for the attrib dos command (on my Windows 7, anyway):

Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [+I | -I] 
       [drive:][path][filename] [/S [/D] [/L]]

  +   Sets an attribute.
  -   Clears an attribute.
  R   Read-only file attribute.
  A   Archive file attribute.
  S   System file attribute.
  H   Hidden file attribute.
  I   Not content indexed file attribute.
  [drive:][path][filename]
      Specifies a file or files for attrib to process.
  /S  Processes matching files in the current folder
      and all subfolders.
  /D  Processes folders as well.
  /L  Work on the attributes of the Symbolic Link versus
      the target of the Symbolic Link

it's not even listed in the help for the attrib dos command on Windows 10 (although some newer file attributes are listed):

Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [+O | -O] [+I | -I] [+P | -P] [+U | -U]
       [drive:][path][filename] [/S [/D]] [/L]

  +   Sets an attribute.
  -   Clears an attribute.
  R   Read-only file attribute.
  A   Archive file attribute.
  S   System file attribute.
  H   Hidden file attribute.
  O   Offline attribute.
  I   Not content indexed file attribute.
  X   No scrub file attribute.
  V   Integrity attribute.
  P   Pinned attribute.
  U   Unpinned attribute.
  [drive:][path][filename]
      Specifies a file or files for attrib to process.
  /S  Processes matching files in the current folder
      and all subfolders.
  /D  Processes folders as well.
  /L  Work on the attributes of the Symbolic Link versus
      the target of the Symbolic Link

however it is documented and supported by AutoIt FileGetAttrib and FileSetAttrib (which, b.t.w., do not mention the newer Windows 10 attributes. but that's off-topic).

the reason i'm asking is this: i'm using (some-sort-of) one-way IPC between two compiled scripts, where one submits a file to the other. the sender writes the file, and when done, sets its Temporary attribute. the receiver periodically checks for that file having its Temporary attribute set, and if so, clears that attribute, moves the file to a another folder and processes it.

so far this is working properly. however i'm wondering if the OS or some other services have their own intentions for the Temporary file attribute, which may cripple my design.

so, does anyone have any idea what the Temporary file attribute is formally intended for?

thanks for any hints.

 

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

  • Developers

https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx  ==> FILE_ATTRIBUTE_TEMPORARY   256 (0x100) ?

 

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

thanks for that reference. it reads:

A file that is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is available, because typically, an application deletes a temporary file after the handle is closed. In that scenario, the system can entirely avoid writing the data. Otherwise, the data is written after the handle is closed.

a perfect example of obscurity. what i don't understand is - does it mean the OS is using that attribute, or is it for use by the application only?

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

  • Developers

What I understood is that it is used for things like DFS, where it won't sync the files that have this attribute set, but haven't read thing in much detail. 

Jos 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

i have stumbled upon the DFS aspect, however it strikes me as a side-effect. it seems a bit far-fetched to assume that a dedicated file attribute was designed for the specific purpose of controlling DFS synchronization. i feel it was designed for a more general purpose, and the DFS mechanism only joined the ride. yes it makes some sense for the OS to support a file attribute for an application to set and for other services to act differently upon (the "Archive" attribute is such an example); if that was the intent, it is very poorly documented, if at all. for example, it would make sense if the various backup tools built-in to Windows would not backup "Temporary" files; yet i find no documentation of that (and no angry users asking questions about it in support forums, as i see for the DFS behaviour...;) ).

regardless of the original intent, if the OS does not perform any near-real-time operations on "Temporary" files, i see no reason that my file submission process should be affected.

 

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...