The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fileman::getfile Base Dir

Discussion in 'cPanel Developers' started by gatorheel, Oct 14, 2011.

  1. gatorheel

    gatorheel Registered

    Joined:
    Oct 14, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I'm writing a perl script to be used by website owners to automate some cPanel tasks. I'm trying to use Fileman::getfile, but it's failing with the following reason string:

    I know the file name is correct since it's pulled earlier using the API, so I assume I'm not using the correct dir. Any tips on what the base dir is from an end-user perspective? Seems like I could have guessed it after a few trials, but I've tried providing a full path and a relative path from the user's home dir w/o luck.

    Thanks,
    Matt
     
  2. gatorheel

    gatorheel Registered

    Joined:
    Oct 14, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Amazing how after thrashing for an hour I answer my own question ten minutes after I break down and post. The problem was that I didn't realize that API1 needs an array for params instead of a hash (like API2). A rereading of the docs made it obvious....

    Matt
     
  3. gatorheel

    gatorheel Registered

    Joined:
    Oct 14, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    It wasn't the source of my problem (since the file name was blank due to me using a hash instead of an array) but I thought I would go ahead and note for future readers that "dir" is relative to the user's home directory (as shown in cPanel under "Home Directory", i.e. "/" as used in the API is equivalent to "~" in the shell.

    Matt
     
Loading...

Share This Page