Accessing Windows File Comments

Accessing Windows File Comments

am 25.02.2010 15:59:07 von Floyd Resler

One of my users has asked if I can display comments with a file list on =
their site. So I thought I might be able to use the comments from the =
properties of the file. Is there any way I can access this from PHP? =
The files are actually stored on a Linux box.

Thanks!
Floyd


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Accessing Windows File Comments

am 25.02.2010 16:12:48 von Phpster

On Thu, Feb 25, 2010 at 9:59 AM, Floyd Resler wrote=
:
> One of my users has asked if I can display comments with a file list on t=
heir site. =A0So I thought I might be able to use the comments from the pro=
perties of the file. =A0Is there any way I can access this from PHP? =A0The=
files are actually stored on a Linux box.
>
> Thanks!
> Floyd
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


If you have access to read the files and the comments are clearly
delineated, then its shouldn't be hard to open each file and then pull
out the contents with regex or str parsing.

You might want to store the data somehow, so that in the future you
only have to read in the changed files.


--=20

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Accessing Windows File Comments

am 25.02.2010 16:16:09 von Richard Quadling

On 25 February 2010 14:59, Floyd Resler wrote:
> One of my users has asked if I can display comments with a file list on t=
heir site.  So I thought I might be able to use the comments from the =
properties of the file.  Is there any way I can access this from PHP? =
 The files are actually stored on a Linux box.
>
> Thanks!
> Floyd
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

The comments on a windows file (on the NTFS file system) are held in
Alternative Datastreams
(http://en.wikipedia.org/wiki/Fork_(filesystem)). As far as I know PHP
cannot natively access them, though externals tools exist ...

"LADS - Freeware version 4.10
(C) Copyright 1998-2007 Frank Heyne Software (http://www.heysoft.de)
This program lists files with alternate data streams (ADS)
Use LADS on your own risk!"



Or are you talking about a file whose content is a list of comments?



--=20
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Accessing Windows File Comments

am 25.02.2010 16:34:04 von Richard Quadling

On 25 February 2010 15:16, Richard Quadling wrot=
e:
> On 25 February 2010 14:59, Floyd Resler wrote:
>> One of my users has asked if I can display comments with a file list on =
their site.  So I thought I might be able to use the comments from the=
properties of the file.  Is there any way I can access this from PHP?=
 The files are actually stored on a Linux box.
>>
>> Thanks!
>> Floyd

Using LADS on a file I just added a title and summary to ...

LADS - Freeware version 4.10
(C) Copyright 1998-2007 Frank Heyne Software (http://www.heysoft.de)
This program lists files with alternate data streams (ADS)
Use LADS on your own risk!

Scanning directory D:\Personal
Files\Downloads\Software\Programming\PHP\Browscap\

size ADS in file
---------- ---------------------------------
88 D:\Personal
Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:â™=
=A3DocumentSummaryInformation
204 D:\Personal
Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:â™=
=A3SummaryInformation
0 D:\Personal
Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:{4c8cc15=
5-6c1e-11d1-8e41-00c04fb9386d}

292 bytes in 3 ADS listed


The funny looking symbol can is character #5 which can be entered as
^E. So, ...

more < php_browscap.ini:^ESummaryInformation > lad.log

The file lad.log now contains the content of the SummaryInformation
alternative data stream.

The format of the content of the streams I don't know, sorry.


--=20
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474=
731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Accessing Windows File Comments

am 25.02.2010 17:52:00 von Ashley Sheridan

--=-lAIMoXxWU4eJokUOk8C+
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, 2010-02-25 at 15:34 +0000, Richard Quadling wrote:

> On 25 February 2010 15:16, Richard Quadling wr=
ote:
> > On 25 February 2010 14:59, Floyd Resler wrote:
> >> One of my users has asked if I can display comments with a file list o=
n their site. So I thought I might be able to use the comments from the pr=
operties of the file. Is there any way I can access this from PHP? The fi=
les are actually stored on a Linux box.
> >>
> >> Thanks!
> >> Floyd
>=20
> Using LADS on a file I just added a title and summary to ...
>=20
> LADS - Freeware version 4.10
> (C) Copyright 1998-2007 Frank Heyne Software (http://www.heysoft.de)
> This program lists files with alternate data streams (ADS)
> Use LADS on your own risk!
>=20
> Scanning directory D:\Personal
> Files\Downloads\Software\Programming\PHP\Browscap\
>=20
> size ADS in file
> ---------- ---------------------------------
> 88 D:\Personal
> Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:â™=
=A3DocumentSummaryInformation
> 204 D:\Personal
> Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:â™=
=A3SummaryInformation
> 0 D:\Personal
> Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:{4c8cc=
155-6c1e-11d1-8e41-00c04fb9386d}
>=20
> 292 bytes in 3 ADS listed
>=20
>=20
> The funny looking symbol can is character #5 which can be entered as
> ^E. So, ...
>=20
> more < php_browscap.ini:^ESummaryInformation > lad.log
>=20
> The file lad.log now contains the content of the SummaryInformation
> alternative data stream.
>=20
> The format of the content of the streams I don't know, sorry.
>=20
>=20
> --=20
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
> Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D2134=
74731
> ZOPA : http://uk.zopa.com/member/RQuadling
>=20


If the files exist on a Linux server, then you're out of luck, because
as Richard said, this information is kept in the alternate data streams,
which is part of the NTFS filesystem (and I don't know anyone crazy
enough to install Linux onto an NTFS formatted partition!)

What you could do is store the filenames in a database, and use a second
table for the comments, attributing them to a file. This would lend
itself well for web-based use, but will cause problems if you move the
files (as the database would lose track of them)

Some file formats are built to allow extra data though. For example,
images have EXIF data, for which there are ways to read (and write
afaik) within PHP. Most audio formats have this, and I would assume
video formats too. You'll probably find most file formats have something
available for this, but the deployment will vary from file type to file
type.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-lAIMoXxWU4eJokUOk8C+--

Re: Accessing Windows File Comments

am 25.02.2010 18:06:33 von Floyd Resler

--Apple-Mail-7-1047584941
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8

Thanks for the input, all. I decided to write a quick and easy =
Web-based file manager using my database to store the comments, as =
suggested.

Thanks!
Floyd

On Feb 25, 2010, at 11:52 AM, Ashley Sheridan wrote:

> On Thu, 2010-02-25 at 15:34 +0000, Richard Quadling wrote:
>>=20
>> On 25 February 2010 15:16, Richard Quadling =
wrote:
>> > On 25 February 2010 14:59, Floyd Resler =
wrote:
>> >> One of my users has asked if I can display comments with a file =
list on their site. So I thought I might be able to use the comments =
from the properties of the file. Is there any way I can access this =
from PHP? The files are actually stored on a Linux box.
>> >>
>> >> Thanks!
>> >> Floyd
>>=20
>> Using LADS on a file I just added a title and summary to ...
>>=20
>> LADS - Freeware version 4.10
>> (C) Copyright 1998-2007 Frank Heyne Software (http://www.heysoft.de)
>> This program lists files with alternate data streams (ADS)
>> Use LADS on your own risk!
>>=20
>> Scanning directory D:\Personal
>> Files\Downloads\Software\Programming\PHP\Browscap\
>>=20
>> size ADS in file
>> ---------- ---------------------------------
>> 88 D:\Personal
>> =
Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:â™=A3=
DocumentSummaryInformation
>> 204 D:\Personal
>> =
Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:â™=A3=
SummaryInformation
>> 0 D:\Personal
>> =
Files\Downloads\Software\Programming\PHP\Browscap\php_browsc ap.ini:{4c8cc1=
55-6c1e-11d1-8e41-00c04fb9386d}
>>=20
>> 292 bytes in 3 ADS listed
>>=20
>>=20
>> The funny looking symbol can is character #5 which can be entered as
>> ^E. So, ...
>>=20
>> more < php_browscap.ini:^ESummaryInformation > lad.log
>>=20
>> The file lad.log now contains the content of the SummaryInformation
>> alternative data stream.
>>=20
>> The format of the content of the streams I don't know, sorry.
>>=20
>>=20
>> --=20
>> -----
>> Richard Quadling
>> "Standing on the shoulders of some very clever giants!"
>> EE : http://www.experts-exchange.com/M_248814.html
>> EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
>> Zend Certified Engineer : =
http://zend.com/zce.php?c=3DZEND002498&r=3D213474731
>> ZOPA : http://uk.zopa.com/member/RQuadling
>>=20
>=20
> If the files exist on a Linux server, then you're out of luck, because =
as Richard said, this information is kept in the alternate data streams, =
which is part of the NTFS filesystem (and I don't know anyone crazy =
enough to install Linux onto an NTFS formatted partition!)
>=20
> What you could do is store the filenames in a database, and use a =
second table for the comments, attributing them to a file. This would =
lend itself well for web-based use, but will cause problems if you move =
the files (as the database would lose track of them)
>=20
> Some file formats are built to allow extra data though. For example, =
images have EXIF data, for which there are ways to read (and write =
afaik) within PHP. Most audio formats have this, and I would assume =
video formats too. You'll probably find most file formats have something =
available for this, but the deployment will vary from file type to file =
type.
>=20
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>=20
>=20


--Apple-Mail-7-1047584941--