Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Thu, 8 Sep 2005 14:25:13 +0200,    group: microsoft.public.platformsdk.ui_shell        back       


Adding some information to a file   
Hello I store in my application directory thousands of files.
I want to attach a string(id) to each of the files so when I'll look for 
this string I will not have to open the file, read it get the string and 
close the file.
What is the best way to do it ?
Thanks,
Janiv Ratson
date: Thu, 8 Sep 2005 14:25:13 +0200   author:   Janiv Ratson

Re: Adding some information to a file   
Janiv Ratson wrote:
> Hello I store in my application directory thousands of files.
> I want to attach a string(id) to each of the files so when I'll look
> for this string I will not have to open the file, read it get the
> string and close the file.
> What is the best way to do it ?

If the directory is in a NTFS partition you could use the NTFS property set storage or a custom NTFS stream. Otherwise, you'll have to maintain some sort of private database in a file, registry key, etc.

-- 
Jim Barry, MVP for Windows SDK
date: Thu, 8 Sep 2005 13:42:35 +0100   author:   Jim Barry

Re: Adding some information to a file   
Jim Barry mentioned NTFS streams.

If you limit your application to Windows XP and Windows 2003,
you can create and embed streams.

You can then use the FindFirstStream, FindNextStream API to locate
WIN32_FIND_STREAM_DATA stream data which contains a stream
name.  You can then ignore the file when it contains an embedded stream
with a stream name of your choice.

You don't need to open and close any files.  Just search for them!


"Jim Barry"  wrote in message 
news:erS5CLHtFHA.1372@TK2MSFTNGP09.phx.gbl...
Janiv Ratson wrote:
> Hello I store in my application directory thousands of files.
> I want to attach a string(id) to each of the files so when I'll look
> for this string I will not have to open the file, read it get the
> string and close the file.
> What is the best way to do it ?

If the directory is in a NTFS partition you could use the NTFS property set 
storage or a custom NTFS stream. Otherwise, you'll have to maintain some 
sort of private database in a file, registry key, etc.

-- 
Jim Barry, MVP for Windows SDK
date: Thu, 8 Sep 2005 13:39:27 -0400   author:   Michael Phillips, Jr. 0.c0m

Re: Adding some information to a file   
Correction the NTFS stream API is only available on Windows 2003 and 
LongHorn.


"Michael Phillips, Jr." <mphillips53@nospam.jun0.c0m> wrote in message 
news:uYKj$wJtFHA.1252@TK2MSFTNGP09.phx.gbl...
> Jim Barry mentioned NTFS streams.
>
> If you limit your application to Windows XP and Windows 2003,
> you can create and embed streams.
>
> You can then use the FindFirstStream, FindNextStream API to locate
> WIN32_FIND_STREAM_DATA stream data which contains a stream
> name.  You can then ignore the file when it contains an embedded stream
> with a stream name of your choice.
>
> You don't need to open and close any files.  Just search for them!
>
>
> "Jim Barry"  wrote in message 
> news:erS5CLHtFHA.1372@TK2MSFTNGP09.phx.gbl...
> Janiv Ratson wrote:
>> Hello I store in my application directory thousands of files.
>> I want to attach a string(id) to each of the files so when I'll look
>> for this string I will not have to open the file, read it get the
>> string and close the file.
>> What is the best way to do it ?
>
> If the directory is in a NTFS partition you could use the NTFS property 
> set storage or a custom NTFS stream. Otherwise, you'll have to maintain 
> some sort of private database in a file, registry key, etc.
>
> -- 
> Jim Barry, MVP for Windows SDK
>
date: Thu, 8 Sep 2005 13:41:38 -0400   author:   Michael Phillips, Jr. 0.c0m

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us