File System Watcher

Is there any API that I can use to get file change notfications in a directory. For example, a user drops a file in a directory, can I get a notification to my app that a new file exists in that directory?

There's no Java api to register for change notifications for files or directories
You might consider writing a tid bit of JNI code to accomplish this depeding on your situation...
For example on Windows platforms you can use FindFirstChangeNotification() to facilitate change detection on a directory.

Similar Messages

  • File System Watcher of Powershell on Opening a Folder

    Sorry for double post, since my last post is posted in wrong place.
    I am trying to build a file system watcher on my computer with Windows 7. I am using FileSystemWatcher of Powershell, it works quite good! I can monitor file/folder creating, deleting, renaming and file changing, including all files and folders in subfolders.
    But when I want to monitor the situation that user opens a folder, for example by double clicking, I cannot find any event listeners in Powershell for that, but it is quite important for my file system watcher.
    Does Powershell have this kind of event listener for getting the event of opening a folder? Or is there another better way to do it?
    Thanks!

    You can do that.
     Just be prepared for the possibility that this could potentially generate a huge number of events, and as a result those logs could wrap very quickly and there may be a noticeable degradation in performance from the processor and disk I/O overhead
    required to do that logging.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Warming up File System Cache for BDB Performance

    Hi,
    We are using BDB DPL - JE package for our application.
    With our current machine configuration, we have
    1) 64 GB RAM
    2) 40-50 GB -- Berkley DB Data Size
    To warm up File System Cache, we cat the .jdb files to /dev/null (To minimize the disk access)
    e.g
         // Read all jdb files in the directory
         p = Runtime.getRuntime().exec("cat " + dirPath + "*.jdb >/dev/null 2>&1");
    Our application checks if new data is available every 15 minutes, If new Data is available then it clears all old reference and loads new data along with Cat *.jdb > /dev/null
    I would like to know that if something like this can be done to improve the BDB Read performance, if not is there any better method to Warm Up File System Cache ?
    Thanks,

    We've done a lot of performance testing with how to best utilize memory to maximize BDB performance.
    You'll get the best and most predictable performance by having everything in the DB cache. If the on-disk size of 40-50GB that you mention includes the default 50% utilization, then it should be able to fit. I probably wouldn't use a JVM larger than 56GB and a database cache percentage larger than 80%. But this depends a lot on the size of the keys and values in the database. The larger the keys and values, the closer the DB cache size will be to the on disk size. The preload option that Charles points out can pull everything into the cache to get to peak performance as soon as possible, but depending on your disk subsystem this still might take 30+ minutes.
    If everything does not fit in the DB cache, then your best bet is to devote as much memory as possible to the file system cache. You'll still need a large enough database cache to store the internal nodes of the btree databases. For our application and a dataset of this size, this would mean a JVM of about 5GB and a database cache percentage around 50%.
    I would also experiment with using CacheMode.EVICT_LN or even CacheMode.EVICT_BIN to reduce the presure on the garbage collector. If you have something in the file system cache, you'll get reasonably fast access to it (maybe 25-50% as fast as if it's in the database cache whereas pulling it from disk is 1-5% as fast), so unless you have very high locality between requests you might not want to put it into the database cache. What we found was that data was pulled in from disk, put into the DB cache, stayed there long enough to be promoted during GC to the old generation, and then it was evicted from the DB cache. This long-lived garbage put a lot of strain on the garbage collector, and led to very high stop-the-world GC times. If your application doesn't have latency requirements, then this might not matter as much to you. By setting the cache mode for a database to CacheMode.EVICT_LN, you effectively tell BDB to not to put the value or (leaf node = LN) into the cache.
    Relying on the file system cache is more unpredictable unless you control everything else that happens on the system since it's easy for parts of the BDB database to get evicted. To keep this from happening, I would recommend reading the files more frequently than every 15 minutes. If the files are in the file system cache, then cat'ing them should be fast. (During one test we ran, "cat *.jdb > /dev/null" took 1 minute when the files were on disk, but only 8 seconds when they were in the file system cache.) And if the files are not all in the file system cache, then you want to get them there sooner rather than later. By the way, if you're using Linux, then you can use "echo 1 > /proc/sys/vm/drop_caches" to clear out the file system cache. This might come in handy during testing. Something else to watch out for with ZFS on Solaris is that sequentially reading a large file might not pull it into the file system cache. To prevent the cache from being polluted, it assumes that sequentially reading through a large file doesn't imply that you're going to do a lot of random reads in that file later, so "cat *.jdb > /dev/null" might not pull the files into the ZFS cache.
    That sums up our experience with using the file system cache for BDB data, but I don't know how much of it will translate to your application.

  • Maown - file system monitor for shared group directories

    Maown Info Page
    I needed a way to manage ownership and permissions of files in a shared directory. ACLs and "chmod g+s" alone were not enough so I wrote maown.
    Maown is a file system monitor written in C. It uses inotify to recursively watch a directory tree for file creation and attribute modification. It automatically chowns files to user:group and adjusts group permissions to match user permissions.
    The package includes a daemon with a simple configuration file. Each line in the configuration file specifies a user, a group and a list of directories to monitor:
    <user> <group> <directory> [<directory>...]
    Last edited by Xyne (2012-05-21 02:35:24)

    Maown has been replaced with Autochown.

  • Problem with File System Repository after release change

    Hello,
    we have been changing the Portal release from EP 6.0 to SAP NetWeaver Portal 7.0 SP17. The OS of the host is Windows 2003 Server.
    If I open the component monitor to watch the repostitories, the state of the file system repositories are red and a error message occurred:
    Startup Error:  getting mapped math - Logon failure: unknown user name or bad password
    I checked the logon credentials....they are ok. Also I checked the access from the Portalhost to the Windows File System....it´s ok too.
    In our previous portal release the FSR were ok!!
    Is there a difference between the file system repository configuration in portal 6.0 and portal 7.0?
    Thanks and regards
    Tom

    Hello Hussain,
    I have checked the username and the password of the user who have full access on the Windows file system, but the same error occurred. In the Network Path we have configured a domain user for the file system access. Here is the configuration of the network path:
    Name: Test
    Description: Test
    Networkpath:
    Host\share
    Password: ****
    Re-enter Password: ****
    User: domain\user
    Here the configuration of the repository:
    Name: Test
    Description: Test
    Prefix: /Test
    Lookup Mode: caseless
    Root Directory:
    Host\share
    Repository Services: Nothing
    Property Search Manager: com.sapportals.wcm.repository.manager.generic.search.SimpleManagerSearchManager
    Security Manager: AclSecurityManager
    ACL Manager Cache: ca_cm_rep_acl
    Windows Landscape System: Microsoft_Windows_KM
    Read only: unchecked
    Could it be that I need a user mapping for the access of the windows file system?
    Perhaps the configuration of the Windows Landscape System is wrong?
    regards
    Tom

  • Using JMX for detecting changes in windows file system?

    Can anybody help to find way to watch changes in windows file system.........Or say files are transfer in mounted drive i want to start access to those files as and when they come in drive.....do not wait while transferring all files ..

    Hi,
    JMX is a technology that will let a Java process expose information to a remote client application.
    It doesn't define what information to expose, but simply how to make it available externally.
    JMX per-se cannot be used to detect the kind of things you describe, but if you are able to detect them, JMX will help you making the information available to external applications.
    Hope this helps,
    -- daniel
    [http://blogs.sun.com/jmxetc|http://blogs.sun.com/jmxetc]

  • How to fix file system error 56635 in windows 8.1

    heelo pls help me to fix this problem i cant install any on my laptop.
    file system error 56635 is showing  up wen i install my kaspersky 2015

    Hello Jay,
    The current forum is for developers. I'd suggest asking non-programming questions on the
    Office 2013 and Office 365 ProPlus - IT Pro General Discussions  forum instead.

  • ISE 1.2 VM file system recommendation

    Hi,
    According to http://www.cisco.com/en/US/docs/security/ise/1.2/installation_guide/ise_vmware.html#wp1056074, tabl 4-1 discusses storage requirement for ISE 1.2 in VM environment.  It recommends VMFS.
    What are the implications when using NFS instead?  Is this just a recommendation or an actual requirement?
    At the moment, we use Netapp array which uses NFS for all vApps.  It will be difficult to justify a creation an additional FC HBA just for this one vApp.  Please explain.
    TIA,
    Byung

    If you refer to
    http://www.cisco.com/en/US/docs/security/ise/1.2/installation_guide/ise_vmware.html
    It says :
    Storage
    •File System—VMFS
    We recommend that you use VMFS for storage. Other storage protocols are not tested and might result in some file system errors.
    •Internal Storage—SCSI/SAS
    •External Storage—iSCSI/SAN
    We do not recommend the use of NFS storage.

  • SAP GoLive : File System Response Times and Online Redologs design

    Hello,
    A SAP Going Live Verification session has just been performed on our SAP Production environnement.
    SAP ECC6
    Oracle 10.2.0.2
    Solaris 10
    As usual, we received database configuration instructions, but I'm a little bit skeptical about two of them :
    1/
    We have been told that our file system read response times "do not meet the standard requirements"
    The following datafile has ben considered having a too high average read time per block.
    File name -Blocks read  -  Avg. read time (ms)  -Total read time per datafile (ms)
    /oracle/PMA/sapdata5/sr3700_10/sr3700.data10          67534                         23                               1553282
    I'm surprised that an average read time of 23ms is considered a high value. What are exactly those "standard requirements" ?
    2/
    We have been asked  to increase the size of the online redo logs which are already quite large (54Mb).
    Actually we have BW loading that generates "Chekpoint not comlete" message every night.
    I've read in sap note 79341 that :
    "The disadvantage of big redo log files is the lower checkpoint frequency and the longer time Oracle needs for an instance recovery."
    Frankly, I have problems undertanding this sentence.
    Frequent checkpoints means more redo log file switches, means more archive redo log files generated. right ?
    But how is it that frequent chekpoints should decrease the time necessary for recovery ?
    Thank you.
    Any useful help would be appreciated.

    Hello
    >> I'm surprised that an average read time of 23ms is considered a high value. What are exactly those "standard requirements" ?
    The recommended ("standard") values are published at the end of sapnote #322896.
    23 ms seems really a little bit high to me - for example we have round about 4 to 6 ms on our productive system (with SAN storage).
    >> Frequent checkpoints means more redo log file switches, means more archive redo log files generated. right?
    Correct.
    >> But how is it that frequent chekpoints should decrease the time necessary for recovery ?
    A checkpoint is occured on every logswitch (of the online redologfiles). On a checkpoint event the following 3 things are happening in an oracle database:
    Every dirty block in the buffer cache is written down to the datafiles
    The latest SCN is written (updated) into the datafile header
    The latest SCN is also written to the controlfiles
    If your redologfiles are larger ... checkpoints are not happening so often and in this case the dirty buffers are not written down to the datafiles (in the case of no free space in the buffer cache is needed). So if your instance crashes you need to apply more redologs to the datafiles to be in a consistent state (roll forward). If you have smaller redologfiles more log switches are occured and so the SCNs in the data file headers (and the corresponding data) are closer to the newest SCN -> ergo the recovery is faster.
    But this concept does not really fit the reality because of oracle implements some algorithm to reduce the workload for the DBWR in the case of a checkpoint.
    There are also several parameters (depends on the oracle version) which control that a required recovery time is kept. (for example FAST_START_MTTR_TARGET)
    Regards
    Stefan

  • Error message "Live file system repair is not supported."

    System won't boot. Directed to Disk Utility to repair but get error message "Live file system repair is not supported."  Appreciate all help.
    Thanks.
    John

    I recently ran into a similar issue with my Time Machine backup disk. After about 6 days of no backups - I had swapped the disk for my photo library for a media project; I reattached the Time Machine disk and attempted a backup.
    Time Machine could not backup to the disk. Running Disk Utility and attempting to Repair the disk ended up returning the "Live file system repair is not supported" message.
    After much experimentaion with disk analysis softwares, I came to the realization that the issue might be that the USB disk dock wasn't connected directly to the MacBook Pro - it was daisy-chained through a USB Hub.
    Connecting the USB disk dock directly to the MBP and running Disk Utility appears to have resolved the issue. DU ran for about 6 hours and succesfully repaired the disk. Consequently, I have been able to use that Time Machine disk for subsequent backups.

  • How to get access to the local file system when running with Web Start

    I'm trying to create a JavaFX app that reads and writes image files to the local file system. Unfortunately, when I run it using the JNLP file that NetBeans generates, I get access permission errors when I try to create an Image object from a .png file.
    Is there any way to make this work in Netbeans? I assume I need to sign the jar or something? I tried turning "Enable Web Start" on in the application settings, and "self-sign by generated key", but that made it so the app wouldn't launch at all using the JNLP file.

    Same as usual as with any other web start app : sign the app or modify the policies of the local JRE. Better sign the app with a temp certificate.
    As for the 2nd error (signed app does not launch), I have no idea as I haven't tried using JWS with FX 2.0 yet. Try to activate console and loggin in Java's control panel options (in W7, JWS logs are in c:\users\<userid>\appdata\LocalLow\Sun\Java\Deployment\log) and see if anything appear here.
    Anyway JWS errors are notoriously not easy to figure out and the whole technology in itself is temperamental. Find the tool named JaNeLA on the web it will help you analyze syntax error in your JNLP (though it is not aware of the new syntax introduced for FX 2.0 and may produce lots of errors on those) and head to the JWS forum (Java Web Start & JNLP Andrew Thompson who dwells over there is the author of JaNeLA).

  • Zone install file system failed?

    On the global zone, my /opt file system is like this:
    /dev/dsk/c1t1d0s3 70547482 28931156 40910852 42% /opt
    I am trying to install it in NMSZone1 like this config:
    fs:
    dir: /opt
    special: /dev/dsk/c1t1d0s3
    raw: /dev/rdsk/c1t1d0s3
    type: ufs
    options: [nodevices,logging]
    But failed like this:
    bash-2.05b# zoneadm -z NMSZone1 boot
    zoneadm: zone 'NMSZone1': fsck of '/dev/rdsk/c1t1d0s3' failed with exit status 3
    3; run fsck manually
    zoneadm: zone 'NMSZone1': unable to get zoneid: Invalid argument
    zoneadm: zone 'NMSZone1': unable to destroy zone
    zoneadm: zone 'NMSZone1': call to zoneadmd failed
    Please help me. Thanks.

    It appears that the c1t1d0s3 device is already in use as /opt in the
    global zone. Is that indeed the case? If so, you need to unmount
    it from there (and remove or comment out its entry in the global
    zone's /etc/vfstab) file and then try booting the zone again.

  • Verication file system failed to make partition

    I can't make a partition verification file system failed

    Hello,
    In Disk Utility, try Repair Disk first, you need another boot drive or the Install Disc if this is trying on your Boot Drive.
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.

  • How do I use a NAS file system attached to my router to store iTunes purchases?

    We have four Windows devices networked in our house.  They all run iTunes with the same Apple ID so when any one of them has iTunes running, we can see that computer on our Apple TV.  Two run Windows XP, one runs Vista Business, and the newest runs Windows 7.  Upgrading all to the same Windows software is out of the question.  Our NAS is hung on an "off warranty" Linksys E3000 router which communicates via USB with a 1TB NTFS formatted Western Digital hard drive.  Our plan when we set up this little network, not cheaply, in our 1939 baloon construction tank of a house, was to build our library of digital images, music, and video primarily on that device.  It supports a variant of Windows streaming support, but poorly.  The best streaming support for our environment seems to be our ethernet connected Apple TV which is hung off the big TV in our family room, and has access to the surround sound "Home Theater" in that room.  We've incrementally built up collections of photos, digitized music, and most recently educational materialsd, podcasts, etc. which threaten storage limits on a couple of default C: drives on these windows systems.  iTunes, before the latest upgrades, gave us some feedback on the file system connections it established without going to the properties of the individual files, but the latest one has yet to be figured out.  MP3's and photos behave fairly well, including the recently available connection between Adobe software and iTunes which magically appeared, allowing JPEG files indexed by Adobe Photoshop Elements running on the two fastest computers to show up under control on the Apple TV attached 56' Samsung screen! 
    Problems arose when we started trying to set things up so that purchases downloaded from the iTunes store ended up directly on the NAS, and when things downloaded to a specific iTunes library on one of the Windows boxes caused storage "issues" on that box.  A bigger problem looming in the immediate future is the "housecleaning" effort which is part of my set of "new years resolutions."  How do I get control of all of my collections and merge them on the NAS without duplicate files, or when, for example, we have .ACC and .MP3 versions, only the required "best" option for the specific piece of music becomes a candidate for streaming?
    I envission this consolidation effort as a "once in a lifetime" effort.  I'm 70, my wife is 68 and not as "technical" as I am, so documented procedures will be required. 
    I plan to keep this thread updated with progress and questions as this project proceeds.  Links to "how to" experiences which are well documented, etc. may be appreciated by those who follow it.  I plan to post progress reports and detailed issues going forward.   Please help?

    Step 1 - by trial and error...
    So far, I have been able to create physical files containing MP3 and JPG on the NAS using the Windows XP systems to copy from shared locations on the Vista and Win7 boxes.  This process has been aided by the use of a 600 GB SATA 2 capable hard drive enclosure.  I first attach to Win 7 or Win Vista and reboot to see the local drive spaces formatted on the portable device.  Then I copy files from the user's private directories to the public drive space.  When the portable drive is wired to an XP box, I can use Windows to move the files from the portable device to the NAS without any of the more advanced file attributes being copied to the NAS.  Once the files are on the NAS, I can add the new folder(s) to iTunes on any of the computers and voila, the data becomes sharable via iTunes.  So far, this works for anything that I have completely purchased, or for MP3's I made from the AIC files created when I purchased alblums via iTunes. 
    I have three huge boxes full of vynl records I've accumulated.  The ones that I've successfully digitized via a turntable attached to the sound card on one of my computers and third party software, have found their way to the NAS after being imported into iTunes and using it to bring down available album art work.  In general I've been reasonably well pleased with the sound quality of digital MP3 files created this way, but the software I've been using sometimes has serious problems automatically separating individual songs from the album tracks and re-converting "one at a time" isn't very efficient.

  • Solaris 10  - After installation read only file system

    Dear All,
    I have installed the Solaris 10 on my x86 system with out any problem. The installation was completed successfully. I have followed the installation instructions that are mentioned in the following link.
    http://docs.sun.com/app/docs/doc/817-0544/6mgbagb19?a=view
    I am facing a different problem. I am not able to create even a single file / sub-directory on any of the existing directories. It always says READ ONLY file system can not create firl / directory.
    Please help me how to resolve this issue.
    Thanks in advance.
    Regards,
    Srinivas G

    What do you get for 'svcs -xv' output?
    Darren

Maybe you are looking for

  • Portal Runtime Error when previewing iViews from BP for CRM 4.0 (60.2)

    Hello, We have imported Business Package for CRM 4.0 (60.2) into EP 6.0 (Version: 6.0.19.0.0) according to the installation guide(InstGuide_EN_CRM40_502.pdf). We have also defined SAP_CRM and SAP_R3 Systems in  Portal System Landscape Editor. And we

  • Ipod shows up on PC but not Mac?

    Hi there, I've got a strange problem with my year-old Ipod video 30GB. I accidentally unplugged it from my computer before ejecting it last week. Everything was erased, and since then it won't show up on my Mac at home or at work. It doesn't pop up o

  • How to use Db Provider Factories with System.Data.SqlServerCe

    I'm using SQL Server Compact Edition, but in the future I would like to be able to switch to another SQL Server Edition or even a different database. To achieve this, Microsoft recommends using DB Provider Factories (see: Writing Provider Independent

  • Dynamic content in hGrid

    Hello ! All the examples related to hGrid contain static data. How is it possible to display dynamic data from a table using UIX BC4J ? For example is it possible to display the employees hierarchy ? Regards, Lucian

  • Document Sets and Content Types

    Hi All, I am having trouble in getting the "document sets" content types applied as expected when I try to create a site based off custom template. Scenario: We have 8 document sets stored in a document library. This library is part of a site which w