Re: identifying hidden files and folders

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: identifying hidden files and folders

Juan Delgado
Hi there,

Was just looking for the same thing. I guess through FileStat.mode we
can't still tell if a file/folder is hidden in Windows, right?

On Thu, Jul 3, 2008 at 9:16 AM, Zjnue Brzavi
<[hidden email]> wrote:

> Hi Nicolas,
>
>> "stat" is originally an unix command so you'll only be able to get
>> read/write/execute flags. "hidden" flag is windows specific, so in order to
>> support it would be either necessary to add some specific things to "stat"
>> in order to query some extra flags, or either add the functionality to
>> systools library.
>
> Thanks, I understand. Not sure I'll be able to do this soon, but let's
> see. I think it will be a pretty common need to know if files /
> folders are hidden on Windows. One example is not to include .svn /
> .cvs folders in file listings, but the need is more general obviously.
>
> Thanks,
> Zjnue
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
Juan Delgado - Zárate
http://zarate.tv
http://blog.zarate.tv

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: identifying hidden files and folders

Zjnue Brzavi
Hi Juan,

> Was just looking for the same thing. I guess through FileStat.mode we
> can't still tell if a file/folder is hidden in Windows, right?

I didn't follow this up in the end.
Here are some links that may help if you're going for it.

Win API docs:
http://msdn.microsoft.com/en-us/library/aa139672.aspx
General intro to Win API programming in C:
http://www.winprog.org/tutorial/start.html

Are you maintaining a list of desired systools extensions as part of hippohx?
Perhaps it could be a nice reference for people trying out the Neko C FFI.

Cheers
Z

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: identifying hidden files and folders

Juan Delgado
Hi!

On Mon, Feb 1, 2010 at 6:43 PM, Zjnue Brzavi
<[hidden email]> wrote:

> Hi Juan,
>
>> Was just looking for the same thing. I guess through FileStat.mode we
>> can't still tell if a file/folder is hidden in Windows, right?
>
> I didn't follow this up in the end.
> Here are some links that may help if you're going for it.
>
> Win API docs:
> http://msdn.microsoft.com/en-us/library/aa139672.aspx
> General intro to Win API programming in C:
> http://www.winprog.org/tutorial/start.html
>

Thanks for links Zjune. I think this is what it should be used:

GetFileAttributes:
http://msdn.microsoft.com/en-us/library/aa364944(VS.85).aspx

And FileAttributes:
http://msdn.microsoft.com/en-us/library/ee332330(VS.85).aspx

Now, it would be great adding this to the standard library so FileStat
returns basic information about the file/folder in a cross-platform
manner. Not sure what info is shared between Mac, Linux and Windows,
though. Certainly size, as we can see we can workout what files are
hidden but not sure about last access, permissions, etc.

Nicolas, is this something you would consider looking at or shall we
try to find other methods?

> Are you maintaining a list of desired systools extensions as part of hippohx?
> Perhaps it could be a nice reference for people trying out the Neko C FFI.
>

Not really. I would need to check exactly what Systools functions are
used in HippoHX. I forget them pretty much as soon as I finish
wrapping them :P

Cheers,

Juan

> Cheers
> Z
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
Juan Delgado - Zárate
http://zarate.tv
http://blog.zarate.tv

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: identifying hidden files and folders

Juan Delgado
Also check out the attrib command in Windows:

http://www.computerhope.com/attribhl.htm

It seems to do the work as a (rather crappy) alternative to proper
implementation in standard library.

On Mon, Feb 1, 2010 at 8:51 PM, Juan Delgado <[hidden email]> wrote:

> Hi!
>
> On Mon, Feb 1, 2010 at 6:43 PM, Zjnue Brzavi
> <[hidden email]> wrote:
>> Hi Juan,
>>
>>> Was just looking for the same thing. I guess through FileStat.mode we
>>> can't still tell if a file/folder is hidden in Windows, right?
>>
>> I didn't follow this up in the end.
>> Here are some links that may help if you're going for it.
>>
>> Win API docs:
>> http://msdn.microsoft.com/en-us/library/aa139672.aspx
>> General intro to Win API programming in C:
>> http://www.winprog.org/tutorial/start.html
>>
>
> Thanks for links Zjune. I think this is what it should be used:
>
> GetFileAttributes:
> http://msdn.microsoft.com/en-us/library/aa364944(VS.85).aspx
>
> And FileAttributes:
> http://msdn.microsoft.com/en-us/library/ee332330(VS.85).aspx
>
> Now, it would be great adding this to the standard library so FileStat
> returns basic information about the file/folder in a cross-platform
> manner. Not sure what info is shared between Mac, Linux and Windows,
> though. Certainly size, as we can see we can workout what files are
> hidden but not sure about last access, permissions, etc.
>
> Nicolas, is this something you would consider looking at or shall we
> try to find other methods?
>
>> Are you maintaining a list of desired systools extensions as part of hippohx?
>> Perhaps it could be a nice reference for people trying out the Neko C FFI.
>>
>
> Not really. I would need to check exactly what Systools functions are
> used in HippoHX. I forget them pretty much as soon as I finish
> wrapping them :P
>
> Cheers,
>
> Juan
>
>> Cheers
>> Z
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>
>
> --
> Juan Delgado - Zárate
> http://zarate.tv
> http://blog.zarate.tv
>



--
Juan Delgado - Zárate
http://zarate.tv
http://blog.zarate.tv

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: identifying hidden files and folders

Zjnue Brzavi
In reply to this post by Juan Delgado
>> Win API docs:
>> http://msdn.microsoft.com/en-us/library/aa139672.aspx
>> General intro to Win API programming in C:
>> http://www.winprog.org/tutorial/start.html
>>
>
> Thanks for links Zjune. I think this is what it should be used:
>
> GetFileAttributes:
> http://msdn.microsoft.com/en-us/library/aa364944(VS.85).aspx
>
> And FileAttributes:
> http://msdn.microsoft.com/en-us/library/ee332330(VS.85).aspx

Np, good research!

>> Are you maintaining a list of desired systools extensions as part of hippohx?
>> Perhaps it could be a nice reference for people trying out the Neko C FFI.
>>
>
> Not really. I would need to check exactly what Systools functions are
> used in HippoHX. I forget them pretty much as soon as I finish
> wrapping them :P

That's what wrapping is for :) The neko-systools googlecode page is
perhaps the best for that anyway.

> Also check out the attrib command in Windows:
>
> http://www.computerhope.com/attribhl.htm
>
> It seems to do the work as a (rather crappy) alternative to proper
> implementation in standard library.

Yep, above calls look better.

Cheers

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: identifying hidden files and folders

Juan Delgado
If anyone is interested, I've just implemented this in XAPI. See
xa.FileSystem.isHidden(path);

http://github.com/zarate/xapi/blob/master/src/xa/FileSystem.hx

For Mac/Linux, anything starting with "." is considered hidden. In
Windows, it's using the attrib command which makes the thing fairly
slow, but at least it seems to work.

Also, be aware that in Mac there're several methods of hiding files,
check this out:

http://www.westwind.com/reference/OS-X/invisibles.html

I'm not matching the path against ./hidden, so isHidden is not 100%
"working" but it would still cover most cases. I'll think about adding
this extra check, though.

HTH,

J

On Mon, Feb 1, 2010 at 9:32 PM, Zjnue Brzavi
<[hidden email]> wrote:

>>> Win API docs:
>>> http://msdn.microsoft.com/en-us/library/aa139672.aspx
>>> General intro to Win API programming in C:
>>> http://www.winprog.org/tutorial/start.html
>>>
>>
>> Thanks for links Zjune. I think this is what it should be used:
>>
>> GetFileAttributes:
>> http://msdn.microsoft.com/en-us/library/aa364944(VS.85).aspx
>>
>> And FileAttributes:
>> http://msdn.microsoft.com/en-us/library/ee332330(VS.85).aspx
>
> Np, good research!
>
>>> Are you maintaining a list of desired systools extensions as part of hippohx?
>>> Perhaps it could be a nice reference for people trying out the Neko C FFI.
>>>
>>
>> Not really. I would need to check exactly what Systools functions are
>> used in HippoHX. I forget them pretty much as soon as I finish
>> wrapping them :P
>
> That's what wrapping is for :) The neko-systools googlecode page is
> perhaps the best for that anyway.
>
>> Also check out the attrib command in Windows:
>>
>> http://www.computerhope.com/attribhl.htm
>>
>> It seems to do the work as a (rather crappy) alternative to proper
>> implementation in standard library.
>
> Yep, above calls look better.
>
> Cheers
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
Juan Delgado - Zárate
http://zarate.tv
http://blog.zarate.tv

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: identifying hidden files and folders

Juan Delgado
Please note, though, that /.hidden is deprecated, although Finder will
honor it it's present on the system (it's not on my Leopard).

J

On Wed, Feb 10, 2010 at 11:54 AM, Juan Delgado <[hidden email]> wrote:

> If anyone is interested, I've just implemented this in XAPI. See
> xa.FileSystem.isHidden(path);
>
> http://github.com/zarate/xapi/blob/master/src/xa/FileSystem.hx
>
> For Mac/Linux, anything starting with "." is considered hidden. In
> Windows, it's using the attrib command which makes the thing fairly
> slow, but at least it seems to work.
>
> Also, be aware that in Mac there're several methods of hiding files,
> check this out:
>
> http://www.westwind.com/reference/OS-X/invisibles.html
>
> I'm not matching the path against ./hidden, so isHidden is not 100%
> "working" but it would still cover most cases. I'll think about adding
> this extra check, though.
>
> HTH,
>
> J
>
> On Mon, Feb 1, 2010 at 9:32 PM, Zjnue Brzavi
> <[hidden email]> wrote:
>>>> Win API docs:
>>>> http://msdn.microsoft.com/en-us/library/aa139672.aspx
>>>> General intro to Win API programming in C:
>>>> http://www.winprog.org/tutorial/start.html
>>>>
>>>
>>> Thanks for links Zjune. I think this is what it should be used:
>>>
>>> GetFileAttributes:
>>> http://msdn.microsoft.com/en-us/library/aa364944(VS.85).aspx
>>>
>>> And FileAttributes:
>>> http://msdn.microsoft.com/en-us/library/ee332330(VS.85).aspx
>>
>> Np, good research!
>>
>>>> Are you maintaining a list of desired systools extensions as part of hippohx?
>>>> Perhaps it could be a nice reference for people trying out the Neko C FFI.
>>>>
>>>
>>> Not really. I would need to check exactly what Systools functions are
>>> used in HippoHX. I forget them pretty much as soon as I finish
>>> wrapping them :P
>>
>> That's what wrapping is for :) The neko-systools googlecode page is
>> perhaps the best for that anyway.
>>
>>> Also check out the attrib command in Windows:
>>>
>>> http://www.computerhope.com/attribhl.htm
>>>
>>> It seems to do the work as a (rather crappy) alternative to proper
>>> implementation in standard library.
>>
>> Yep, above calls look better.
>>
>> Cheers
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>
>
> --
> Juan Delgado - Zárate
> http://zarate.tv
> http://blog.zarate.tv
>



--
Juan Delgado - Zárate
http://zarate.tv
http://blog.zarate.tv

--
haXe - an open source web programming language
http://haxe.org