Questions tagged [pathname]

Anything related to pathnames. A pathname is a symbolic, hierarchical representation of the location of a file (or other resource) in a filesystem encoded as a string. The rules governing the syntax of pathnames differ among OSes (and sometimes among filesystems). Here is an example for Linux: "/home/user/foo/bar/hello.pdf" and one for Windows: "D:\data\foo\bar\hello.pdf"

189 questions
3
votes
1 answer

Get last component of pathname in Common Lisp

While I can build a pathname e.g. (make-pathname :directory '(:RELATIVE "dir" "subdir" "subsubdir")) how do I get back subsubdir from a pathname like this (assuming it is a directory)? I need to extract the last dir from a pathname, just as this…
2
votes
1 answer

window Location - only protocol, hostname and pathname

Say I have this URL: http://www.domain.com/subpage/?somsearch#somehash? Is there a standard way to get the following result, without hash and search: http://www.domain.com/subpage/ This is how I do it now: var windowLocation =…
Hakan
  • 3,835
  • 14
  • 45
  • 66
2
votes
1 answer

How do you access a Ruby on Rails Rails.root.join yml file from the console?

I have data stored in the following file: guess what data it is? :) S3_CREDENTIALS = Rails.root.join("config/s3.yml") To confirm it's working, I fired up rails console and found S3_CREDENTIALS is a Pathname object. But I'm having trouble…
Geoff
  • 9,470
  • 13
  • 52
  • 67
2
votes
1 answer

Why does Pathname.rmtree fail on Signal.trap('EXIT')

I’m trying to make a temporary directory that is removed when the script exits. #!/usr/bin/env ruby require 'pathname' require 'tmpdir' Tmp_dir = Pathname.new(Dir.mktmpdir) Signal.trap('EXIT') { Tmp_dir.rmtree puts 'Doing cleanup' } puts…
user137369
  • 5,219
  • 5
  • 31
  • 54
2
votes
2 answers

Ruby: Breaking from an Inline Block

Update Ignore the following. It turned out to be a bug restricted to Macruby 0.10 and probably specific to my install. I'll leave the post in case anyone else hits the problem. I seemed to misunderstood something about ruby blocks. I wanted to use…
TechZen
  • 64,370
  • 15
  • 118
  • 145
2
votes
0 answers

Sharepoint 2016 internet explorer error - window.location.pathname is undefined

Hello i'm facing this problem in a sharepoint 2016 on-prem environment. i customize my masterpage (starting from the seattle one) adding some custom javascript such as following...............
2
votes
2 answers

Finding path names with non-consecutive numbers using glob in Python

Is there a way to find file names with numbers that are not consecutive? More specifically, I'm looking to list filenames with these numbers included: path +'*.s201701*.nc' path +'*.s201801*.nc' path +'*.s201901*.nc' path +'*.s201702*.nc' path…
Cynthia GS
  • 522
  • 4
  • 20
2
votes
2 answers

How to keep the props.location.state after refreshing page?(without using local storagre)

I used this Link , when i refresh the page props.location.state === null any solution to keep the data in props.location.state when refreshing or charging new pages without using local storage?
Maria-Elena
  • 127
  • 1
  • 11
2
votes
1 answer

NSIS Runtime CMD with spaces in path and parameter

I have a Windows .bat script which needs to be run from a NSIS installer at runtime. The script is invoked as follows: ; Debug Messages to check values set correctly MessageBox MB_OK "Script ${INSTDIR}\script\settingsLocation.bat" …
TenG
  • 3,843
  • 2
  • 25
  • 42
2
votes
1 answer

Waypoints Uncaught Error

I'm using waypoints to change the color of my fixed header based on the background color it is over top. I'm using IF and ELSE statements to determine the page, so it knows which elements to change colors over. Only the INDEX page am I getting this…
user3817083
  • 79
  • 1
  • 7
2
votes
2 answers

What is the meaning of '{**}' in Pathname#join

In my Rails project in application.rb file there is a line, which is written by some previous developer who was working on the project. config.autoload_paths += Dir[Rails.root.join('app', 'classes', '{**}')] I know that autoload_paths is used by…
dnsh
  • 3,516
  • 2
  • 22
  • 47
2
votes
2 answers

How to get a path to a resource/file out of a Java JAR file

I'm trying to get the path to a file that it is located out of the java jar and I don't want to use an absolute path. An exampel: lets say that the jar is located in ~/lib/myjar.jar and the file is located in the same folder. What I've trying is…
testk
  • 147
  • 2
  • 7
2
votes
2 answers

What is a pathname string's prefix and its length in JAVA?

File.java uses a variable as: private final transient int prefixLength; And says, this is "abstract pathname's prefix". File.java also have a constructor as: public File(String pathname) { if (pathname == null) { throw new…
my name is GYAN
  • 1,269
  • 13
  • 27
2
votes
1 answer

Ordering in Ruby Pathname .children

It seems the order of the filesystem entities returned by Pathname's .children method is arbitrary or at least not alphabetical. Is there a way to have these returned in alphabetical order via the file system rather than calling .sort on the…
Brendon Muir
  • 4,540
  • 2
  • 33
  • 55
2
votes
1 answer

Zsh does not expand path in `--flag=path` style arguments

In bash: $ foo --bar=/tmp/ba expands to foo --bar/tmp/baz. In my zsh install, no expansion is performed here (but is performed as expected when the path is separated by whitespace, i.e. foo --bar /tmp/ba). What zsh setting do I need to…
Sasgorilla
  • 2,403
  • 2
  • 29
  • 56