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
7
votes
3 answers

Common Lisp: relative path to absolute

May be it is a really dumb question, but after playing around with all built-in pathname-family functions and cl-fad/pathname-utils packages I still can't figure out how to convert a relative path to absolute (with respect to $PWD): ; let PWD be…
AlexDarkVoid
  • 485
  • 3
  • 12
6
votes
2 answers

Strange behavior from .NET regarding file paths

I couldn't find any information on this through professor Google, so here I am. Take the given path name and paste it into Windows Explorer. I stumbled across this after discovering bug in my code that generated the paths with an extra '.' in the…
zackery.fix
  • 1,786
  • 2
  • 11
  • 20
5
votes
2 answers

How to obtain a pathname or dentry or struct file from a given inode?

I need to know how to obtain a pathname or dentry or struct file from a given inode. I was using file_open to obtain struct file from a pathname but but always gave kernel panic. I need a way to compare an inode from my list of inodes with a inode…
Leonardo
  • 61
  • 1
  • 3
5
votes
2 answers

How to search for files with a wildcard in Common Lisp?

I am not satisfied to find files matching a string like this: (remove-if-not (lambda (it) (search "wildcard" (namestring it))) (uiop:directory-files "./")) ;; I'll ignore case with str:contains? ;;…
Ehvince
  • 17,274
  • 7
  • 58
  • 79
5
votes
2 answers

How to "convert" window.location.pathname from object to string?

I need pathname (www.my-site.com/this-part/and-this-part/etc/) in JS/jQuery but I need it as string not as object. In other words I need $_SERVER['REQUEST_URI']; in JS/jQuery. I've tried: var page_pathname = location.pathname; var page_pathname =…
Solo
  • 6,687
  • 7
  • 35
  • 67
5
votes
3 answers

pathnames in Common Lisp, filenames with wildcards in them

The characters * and ? are used as wildcards in pathnames. How does one refer to a filename that has ? as one of its actual characters? For example: [18]> (wild-pathname-p #p"foo") NIL [19]> (wild-pathname-p #p"foo?") T So referring to the…
Mayer Goldberg
  • 1,378
  • 11
  • 23
5
votes
1 answer

Laravel - how to get path name of file

In Laravel im using this code in my controller to get files from directory: public function galleryImages($album) { $images = File::allFiles('gallery/'.$album); return View::make('galleryimages', ['images' => $images]); } and in my…
Axel Stone
  • 1,521
  • 4
  • 23
  • 43
5
votes
1 answer

Get current file name from a url using javascript/jquery when only folder path is known

I am trying to get the current filename from the url using: $currentFile = window.location.pathname.split("/").pop(); This works fine if the full path is something like: http://www.yoursite.com/folder/index.php It will return index.php, index.cfm,…
lharby
  • 3,057
  • 5
  • 24
  • 56
5
votes
2 answers

Concatenating absolute paths with the Pathname class

I am working on a project where I have a dynamically determined mount point and am provided a set of absolute paths to do work on on the target volume. Since these files don't exist yet, I am using the Pathname class to handle the filename…
angelixd
  • 300
  • 1
  • 7
4
votes
2 answers

Question about pathname encoding

What have I done to get such a strange encoding in this path-name? In my file manager (Dolphin) the path-name looks good. #!/usr/local/bin/perl use warnings; use 5.014; use utf8; use open qw( :encoding(UTF-8) :std ); use File::Find; use…
sid_com
  • 24,137
  • 26
  • 96
  • 187
4
votes
1 answer

How do you remove directory qualifiers to simplify pathname using the Win32 API?

If you have a path like "C:\foo\.\bar\.." is there an easy way using the Win32 API to remove the directory qualifiers in order to simplify it to "C:\foo" ? Update: It seems to be a more complicated issue. On this simple example of…
Adisak
  • 6,708
  • 38
  • 46
4
votes
3 answers

Expand a file name with a tilde to its fullpath (Common Lisp)

I have a directory name (as string) with a tilde: ~/projects. I want to get its fullpath: /home/user/projects. How do I do that ? The goal is to pass it to uiop:run-program, that doesn't seem to do the right thing©. With this answer: How to…
Ehvince
  • 17,274
  • 7
  • 58
  • 79
4
votes
2 answers

jq: convert array to object indexed by filename?

Using jq how can I convert an array into object indexed by filename, or read multiple files into one object indexed by their filename? e.g. jq -s 'map(select(.roles[]? | contains ("mysql")))' -C dir/file1.json dir/file2.json This gives me the data…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
4
votes
3 answers

How to extract path from a string in ruby (between 1st and last fwd slash inclusive)

I have been writing a ruby script that goes through a text file and locates all lines that begin with output path and stores it into a string (linefromtextfile) for that line. So typically it locates lines as…
adamjth
  • 75
  • 4
4
votes
1 answer

javascript location search for multiple query params in url

For a url such as http://example.com/x1/x2?qp1a=val1&qp1b=val2#/y1/y2?qp2a=val1b&qp2b=val2b location.pathname = x1/x2 and location.search = ?qp1a=val1&qp1b=val2 how to get y1/y2 and ?qp2a=val1b&qp2b=val2b USING window.location Note: I know to…
wallop
  • 2,510
  • 1
  • 22
  • 39
1
2
3
12 13