Hello Praveen,

Thanks for you reply
I tried with following script and it worked

import win32file
import win32con

int a = win32file.GetFileAttributes("C:\\TestFiles\\r.txt") &
win32con.FILE_ATTRIBUTE_HIDDEN

win32file.GetFileAttributes("C:\\TestFiles\\r.txt")  will return 32 if
the file is without any special attributes.
34 in case the file is only hidden
35 if the file is hidden and readonly

finally int a will be 2 if the file is hidden or does not  exist and 0
if the file exists and not readonly.



On Apr 13, 9:48 am, Praveen <praveen.python.pl...@gmail.com> wrote:
> There is not a big deal.
> If you want to find the hiddend file on windos there is one command
> attrib -h
> for more info look athttp://commandwindows.com/command2.htmand find
> for "Changing file attributes with "attrib" "
> for unixhttp://www.faqs.org/docs/securing/chap5sec62.html
> you need to write and script to run these commands.
> I just give you small example
>
> import command
> command.getoutput('ls')
>
> which will list you all the dir(s) and file(s).
> regards
> Praveen
>
> On Apr 12, 5:47 pm, Pradnya <pradnya.pa...@gmail.com> wrote:
>
> > Hello,
>
> > I am using Django with Python on windows. I want to list the files
> > from specific directory and want to highlight files / directories
> > which are hidden. How to recognize a file / directory as it's hidden?
>
> > This particular application could be running on Unix / Linux platform.
> > Is there any common method which gives information as the file is
> > hidden? Or if it is possible using file header?
>
> > Please suggest.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to