• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSFileManager directory lists and hidden files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSFileManager directory lists and hidden files


  • Subject: NSFileManager directory lists and hidden files
  • From: Michael Hall <email@hidden>
  • Date: Sat, 07 Jul 2012 17:58:08 -0500

I am trying to write something using kqueue to monitor a directory. It is my understanding that for file creation I will be told a directory has been written to and I then have to list the directory myself to determine the file added.

I add the original directory path files using enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: which I gather is the preferred deep, subdirectories included, lister choice.
This seems to have an option to omit hidden files. I am not using it but  still do not seem to get .DS_Store

When I receive a kqueue event that a directory has been written to I attempt to use contentsOfDirectoryAtPath to get a shallow, no subdirectories, list I can check for a file I didn't previously know about. This list does appear to include .DS_Store, the result being that I keep thinking this is the file being created.

2012-07-07 17:30:56.658 java[1680:5003] UKKQueue: Detected file change: /Users/mjh/trz/
     [exec] 2012-07-07 17:30:56.664 java[1680:5003] created .DS_Store
     [exec] 2012-07-07 17:30:56.665 java[1680:5003] UKKQueue: Detected file change: /Users/mjh/trz/
     [exec] 2012-07-07 17:30:56.667 java[1680:5003] created .DS_Store

The code based on UK source as you see.
Although I don't think relevant you might also note the java as this is being run off of jni.
I just created another hidden file just to verify enumeratorAtURL would default skip it and it seems to default ignore.

How do I get the enumeratorAtURL to include the .DS_Store files. Or do I have to add my own filter to contentsOfDirectoryAtPath to skip hidden files for consistency?






_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSFileManager directory lists and hidden files
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Document Based Application
  • Next by Date: How to set a default filter on an NSTableView so that no data is displayed if NSSearchField is empty?
  • Previous by thread: Re: Document Based Application
  • Next by thread: Re: NSFileManager directory lists and hidden files
  • Index(es):
    • Date
    • Thread