I am happy to announce the release of win32-file
0.1.0. This package provides additional methods for
the File class specific to the Win32 platform, mostly
related to file/directory attribute information.
Good work.
Thanks
Synopsis
require âwin32/fileâ
some_file = âC:\Documents and
Settings\some_user\fruitylicious.txtâ
Win32::File.attributes(some_file) # e.g. [âhiddenâ,âarchiveâ]
Why not use symbols instead?
Dunno - didnât think it really mattered. Does it?
[âhiddenâ,âarchiveâ] # > # > Why not use symbols instead?
Dunno - didnât think it really mattered. Does it?
Personally, I generally dislike the symbol-as-hash key
styleâeven if there is some kind of performance gain to be
had from it. So, youâve got my vote to keep it as it is.
Just throwing in a curve ball on this frivolous matter, but
I strongly prefer the symbol style over strings. In fact, it
always bucket me that the reflection methods like
Module#instance_methods or Object#instance_variables
return arrays of strings instead of symbols.
Ps. Thank you very much for all win32 extension -
they are really fantastic! Also what kind of nfts (5+)
features will your win32/file extension support?
Just throwing in a curve ball on this frivolous matter, but
I strongly prefer the symbol style over strings. In fact, it
always bucket me that the reflection methods like
Module#instance_methods or Object#instance_variables
return arrays of strings instead of symbols.
¡¡¡
On Fri, 31 Oct 2003, Christoph wrote:
That (instance_methods and instance_variables), I can agree with. To me,
itâs all in how Iâm going to use something. Itâs rare that I want a hash
key to be a symbol, but itâs fairly often that Iâd like it to be a string.
Ultimately it doesnât really matter too much, though. So, Dan, donât
change it in this case.
On Thursday 30 October 2003 09:59 am, Christoph wrote:
Berger, Daniel wrote:
âŚ
> > Synopsis
> > ========
> > require âwin32/fileâ
> >
> > some_file = "C:\Documents and
> Settings\some_user\fruitylicious.txt"
> >
> > Win32::File.attributes(some_file) # e.g.
[âhiddenâ,âarchiveâ] # > # > Why not use symbols instead?
Dunno - didnât think it really mattered. Does it?
Personally, I generally dislike the symbol-as-hash key
styleâeven if there is some kind of performance gain to be
had from it. So, youâve got my vote to keep it as it is.
Just throwing in a curve ball on this frivolous matter, but
I strongly prefer the symbol style over strings. In fact, it
always bucket me that the reflection methods like
Module#instance_methods or Object#instance_variables
return arrays of strings instead of symbols.
Ps. Thank you very much for all win32 extension -
they are really fantastic! Also what kind of nfts (5+)
features will your win32/file extension support?
[âhiddenâ,âarchiveâ] # > # > Why not use symbols instead?
Dunno - didnât think it really mattered. Does it?
Personally, I generally dislike the symbol-as-hash key
styleâeven if there is some kind of performance gain to be
had from it. So, youâve got my vote to keep it as it is.
Just throwing in a curve ball on this frivolous matter, but
I strongly prefer the symbol style over strings. In fact, it
always bucket me that the reflection methods like
Module#instance_methods or Object#instance_variables
return arrays of strings instead of symbols.
Ps. Thank you very much for all win32 extension -
they are really fantastic! Also what kind of nfts (5+)
features will your win32/file extension support?
Actually, shouldnât these be constants of the File class?
For this particular method I donât think itâs necessary. Itâs certainly
less painful to return and/or parse an array of strings vs. a hash of
hashes that contains constants. However, I may add it in the future for
âsetâ methods. Perhaps something like:
File.chattr(file,AttributeConstant) - Set file win32 attribute
File.chattr(âsome_fileâ,File::HIDDEN)
Iâll think about it. I should also mention that I wouldnât expect this
to be a highly used method, so maybe thatâs why Iâm somewhat indifferent
on the subject. In any case, adding the security stuff has higher
priority at the moment (to answer Christophâs earlier question). Thanks
for the feedback!
Regards,
Dan
¡¡¡
On Thursday 30 October 2003 09:59 am, Christoph wrote: