unable to access the file that's created by mozilla? - Mozilla

This is a discussion on unable to access the file that's created by mozilla? - Mozilla ; Hi Guys, I am created file according to var file = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties) .get("ProfD", Components.interfaces.nsIFile); file.append(*"DIR"*); if( !file.exists() || !file.isDirectory() ) { // if it doesn't exist, create file.create(Components.interfaces.nsIFile.DIRECTOR Y_TYPE, 0664); } from http://developer.mozilla.org/en/docs...ppets:File_I/O I am able to create the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: unable to access the file that's created by mozilla?

  1. unable to access the file that's created by mozilla?

    Hi Guys,

    I am created file according to

    var file = Components.classes["@mozilla.org/file/directory_service;1"]
    .getService(Components.interfaces.nsIProperties)
    .get("ProfD", Components.interfaces.nsIFile);
    file.append(*"DIR"*);
    if( !file.exists() || !file.isDirectory() ) { // if it doesn't exist, create
    file.create(Components.interfaces.nsIFile.DIRECTOR Y_TYPE, 0664);
    }

    from http://developer.mozilla.org/en/docs...ppets:File_I/O

    I am able to create the file, but I am not able to access it using 'cd' or
    'ls' or from konqueror

    My environment is kubuntu 6.04

    Anyone knows what's going on? Any help or direction will be greatly
    appreciated!

    Thanks!

    Lei

  2. Re: unable to access the file that's created by mozilla?

    Lei Sun wrote:

    > if( !file.exists() || !file.isDirectory() ) { // if it doesn't
    > exist, create
    > file.create(Components.interfaces.nsIFile.DIRECTOR Y_TYPE, 0664);
    > }
    >
    > from http://developer.mozilla.org/en/docs...ppets:File_I/O


    The permission modes listed in that article are incorrect. Permissions
    should generally be 0777 for directories and 0666 for files, unless
    there is a special need for the file to be private, in which case you
    should use 0600.

    Note that the permission bits you request may not be the resulting
    permissions depending on the user's umask.

    --
    Warning: May contain traces of nuts.

  3. Re: unable to access the file that's created by mozilla?

    Thanks Neil,

    It worked!

    On 7/13/07, Neil wrote:
    >
    > Lei Sun wrote:
    >
    > > if( !file.exists() || !file.isDirectory() ) { // if it doesn't
    > > exist, create
    > > file.create(Components.interfaces.nsIFile.DIRECTOR Y_TYPE, 0664);
    > > }
    > >
    > > from http://developer.mozilla.org/en/docs...ppets:File_I/O

    >
    > The permission modes listed in that article are incorrect. Permissions
    > should generally be 0777 for directories and 0666 for files, unless
    > there is a special need for the file to be private, in which case you
    > should use 0600.
    >
    > Note that the permission bits you request may not be the resulting
    > permissions depending on the user's umask.
    >
    > --
    > Warning: May contain traces of nuts.
    > _______________________________________________
    > dev-extensions mailing list
    > dev-extensions@lists.mozilla.org
    > https://lists.mozilla.org/listinfo/dev-extensions
    >


+ Reply to Thread