I work with Asterisk 11.2.1 and I want to compile it with --prefix
mindia#localhost asterisk-11.2.1]$ ./configure --prefix=../
This command throws exception
configure: error: expected an absolute directory name for --prefix: ..
I want to use relative path.Can anybody help me?
you can write it as below
mindia#localhost asterisk-11.2.1]$ ./configure --prefix=/relative/path
not
--prefix=../something
You got the clear response from configure
configure: error: expected an absolute directory name for --prefix: ..
So you are not allowed to use relative path, and you need to provide absolute path. The reason of this behavior, I think, is in the fact that relative path has no sense due to the prefix directory path. If you still have to use relative path, then just use some of the bash or your operation system utilities to convert the relative path to absolute path and substitute that path to your configure command.
Related
WebStorm gives "Cannot resolve directory 'some_path'" error.
if assets path is used instead of relative path. By assets path I mean path starting with /assets/.
There is no problem when relative path is used:
Both codes works well in a browser, but for the first one WebStorm gives errors. How to solve this issue or tell WebStorm to ignore it if the path starts with /assets/?
My original motivation was to run a Deno script from Crontab on Ubuntu.
First I did not know that paths are relative to the working directory, not the executing module.
My script was reading and writing files to a disk, so I got errors like
error: Uncaught NotFound: No such file or directory (os error 2)
I was pointed out that this problem can be solved with import.meta.url.
I modified the path to resolve it from import.meta.url and this solution worked fine with read/write operations.
But I encountered another problem with .env file.
It was a surprise to me that even the dotenv module uses paths relative to the working directory.
The dotenv module has the option to specify the path with config({path:___}), but I think it is too much to overwrite the default location.
Eventually, changing the working directory to the script's root directory before running the script in crontab was a simpler solution.
* * * * * cd ____; deno run ___
But I still have doubts if this is the most efficient way.
Is there something better to changing a directory in such cases?
It would be nice to have a mode when running deno, which would make paths relative to the executing module excluding modules which are imported with URLs.
I think you're looking for Deno.mainModule, which is a reference to the file URL of the entrypoint module you passed to deno. You can use it with the deno.land/std/path module to get the directory of the entrypoint for your program, and then use Deno.chdir() to change your current working directory so that all relative paths (which are implicitly relative to Deno.cwd()) are then relative to that directory.
/repo/relative-path.ts:
import * as path from 'https://deno.land/std#0.102.0/path/mod.ts';
export {path};
export const mainModuleDir = path.dirname(path.fromFileUrl(Deno.mainModule));
/repo/main.ts:
import {mainModuleDir, path} from './relative-path.ts';
Deno.chdir(mainModuleDir);
const entrypointRelativePath = path.resolve('hello', 'world.json');
console.log(entrypointRelativePath);
Then, run your script:
$ cd /different/unrelated/path
$ deno run --allow-read /repo/main.ts
/repo/hello/world.json
You can use mainModuleDir as a base for any entrypoint-relative paths you need.
In the following:
Roberts-MacBook-Pro:Code robertnash$ mkdir Flag
Roberts-MacBook-Pro:Code robertnash$ cd Flag/
Roberts-MacBook-Pro:Flag robertnash$ swift package init --type executable
Roberts-MacBook-Pro:Flag robertnash$ swift build
Compile Swift Module 'Flag' (1 sources)
Linking ./.build/debug/Flag
In order to execute the executable, it must be a path, like so
Roberts-MacBook-Pro:Flag robertnash$ .build/debug/Flag
Hello, world!
If I go to where 'Flag' is located, the command cannot be run by simply typing 'Flag'.
Roberts-MacBook-Pro:Flag robertnash$ cd .build
Roberts-MacBook-Pro:.build robertnash$ cd debug
Roberts-MacBook-Pro:debug robertnash$ Flag
-bash: Flag: command not found
It must be a path, like so.
Roberts-MacBook-Pro:debug robertnash$ ./Flag
Why is that ?
If you run export PATH="$PATH:." then it will add the current working directory to your path and you won't need the ./ prefix. (Most (all?) shells accept just a trailing colon without the dot, but I find it's more explicit about what it does.)
This isn't present by default because it is a security risk: a malicious script could be named as something missing from your path, like nmap or even as a typo like sl, and placed in a directory in the hopes that you run it. Forcing you to prefix ./ is a good way of avoiding that.
Somewhere deep in an Scons build tree that I don't know the details of, a path is being added to the CLASSPATH argument passed to javac.
During the build, I get an error message like:
warning: [path] bad path element "C:Userraedengitrojecesource.jar"
The path that is actually supposed to be passed to javac is "C:\Users\Braeden\git\project\resource.jar".
I'm assuming that what's going on here is that Scons is generating a Windows-styled path somewhere along the way and Python is interpreting the backslashes as escape characters.
This path (nor a relative version of it) is not hard-coded into any build files. Is a catch-all solution available to this problem, or am I going to have to scour the project for the place where this path is generated and correct it?
Is it possible to import a certificate file using a (relative) path? I am trying to follow the example here:
http://msdn.microsoft.com/en-us/library/te7383x5.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2
cert.Import( relative path )
I am not having any success. Keep running into "file not found" exception.
Is a fully-qualified path required?
Win32 documentation discourages use of relative paths so use of the absolute path is strongly recommended.