FAQ Database Discussion Community


Finding the last created FILE in the directory, C++

c++,file,directory
Even though I searched there isn't any problem like mine in the internet. my problem is, I want to get the name of the last file created in the directory. My system will create /.png files coming from my Camera in the directory of this code and I want my...

How to get the name of parent directory in Python? [duplicate]

python,variables,directory
This question already has an answer here: How do I get the parent directory in Python? 12 answers I have a program in python that prints out information about the file system... I need to know to save the name of the parent directory to a variable... For example,...

Iterate through a specific directory tree and store all the .ttf files into an array in PHP

php,loops,iterator,directory,iteration
Lets say I have a lot of files, some of those are in these paths: root/fonts/folder1/font1.ttf root/fonts/folder1/font2.ttf root/fonts/folder2/font1.ttf root/fonts/folder2/font2.ttf root/scripts/file.php Remember that there are also other types of files in those folders. How can my "/scripts/file.php" iterate through the "../fonts/" directory tree and store all the TrueType font (.ttf) files...

How to read files in C# in a directory whose names contain a specific word? [closed]

c#,directory,filenames
I have a directory on my C: drive called practice. I have txt files there with these names: CityUpdated, TownUpdated, MetroNotUpdated, SuburbNotUpdated. I want to write some C# code that reads the text files whose names contain the word "Updated". But I can't figure out how to do this using...

Copy file into multiple directories - Unix

linux,bash,unix,directory,directory-structure
I want to copy one file into many directory. My path structure is like above. folder1-> anotherfolder -> **here I want to copy my file** folder2-> anotherfolder -> **here I want to copy my file** folder3-> anotherfolder -> **here I want to copy my file** folder4-> anotherfolder -> **here I...

dokku - where is my application's directory

directory,find,docker,dokku
I am trying to access logs of my Node.js application which is written in file mylogfile.log inside application's directory. Using find / -type f -name mylogfile.log i was able to see this output: /var/lib/docker/aufs/diff/0303e86afdc58e13b5afcc07ea3694e0e9e6d5e5cf8530a0854a76fbe2baf574/app/mylogfile.log /var/lib/docker/aufs/diff/a9a0dab44456acd8b43915ed686c282b778ab99df31f62076082e121274ef6e2/app/mylogfile.log /var/lib/docker/aufs/mnt/0303e86afdc58e13b5afcc07ea3694e0e9e6d5e5cf8530a0854a76fbe2baf574/app/mylogfile.log What are those...

C# Copy file or folder

c#,file,directory,copy,folder
I am trying to write a program to keep multiple folders in sync. To do this, I need to copy and delete files and subfolders. To me, it doesn't make a difference if an object is a file or a folder, I want to create all necessary parent folders and...

Can I stop Emacs from resetting default-directory every time I open a file?

emacs,directory,editing
I've already asked the same question on Emacs. If it's not permitted, I'm sorry and I will delete the question. If I: Start Emacs in my home directory (~) Find a file in the ~/Projects/ruby-play directory with C-x C-f Try to find another file with C-x C-f The default directory...

open function in c can't find a file when the file name is written with its directory

c,file,directory
The open function works fine when I try to open a file in the current directory but if I mention the directory of the file with its name as a parameter in the open function, the file is not found error happens. Also, when i try to open a file...

Why is my add method in my directory program setting the first four fields to null in my text file when I add a new person?

java,arrays,directory
I have a text file containing all the persons in my program (staff, employee, instructor, and students) and their relevant information depending on the type of person. I have a directory class with all my methods, and a directoryServer which is the interface class. My add method is not working...

How to get file name of directory and written in button or label?

vb.net,directory,filenames
How can I find the file name of a directory? I would like to customize a label or button. Example: LigaBBVA.jpg then on the button or the label, LigaBBVA will also written without the extension....

Bash moving created file

bash,directory,mv
I have a script that creates a file, what is the best way to edit that script that it moves the newly created file into a folder one above the directory it will be put in? Thanks...

SharePoint 2013 - Programmatically access the file in directory from the path present in database table

database,directory,sharepoint-2013
I have a database table with columns like the serial number that is present in the SharePoint list, name of a file and path in which it is stored. That path is a directory path where the file is stored. I need to access that path and then get the...

Docker recreates directories on host after reboot

directory,docker,reboot,docker-compose,recreate
I created some containers on my system (ubuntu 14.04) using docker-compose which mounted directories from the host into the containers. Now, every time I reboot the host, these directories are recreated, even though the containers do not longer exist (and I therefore deleted the directory). Example: I had a container...

Media files end up in in a pycharm subdirectory when uploading

django,upload,directory,settings,media
I am building a Django application on a Windows system where the user should be able to upload images. But somehow my uploades files end up in my Program Files directory at: C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.1\jre\jre\bin\WebApp\media\TestData\static\images I just can't understand why I get this result. I would like...

How to change a file reader to a directory scanner?

java,loops,directory,bufferedreader,inputstreamreader
Answer System.out.print("Enter the name of the directory:"); File a= new File((new BufferedReader(new InputStreamReader(System.in))) .readLine()); File[] b=a.listFiles(); for(int i=1;i < b.length;i++){ fn=b[i].getPath(); } Problem System.out.print("Enter the name of file: "); fn = (new BufferedReader(new InputStreamReader(System.in))) .readLine(); I have tried File[] file Array=new File(System.in).listFiles(); for(File f: fileArray) // loop through all files...

When moving a views to a new directory, what changes must I make for them to work

ruby-on-rails,ruby,directory
To be specific I simply created a subdirectory in the one they were currently contained in and I am now getting Missing template users/index, application/index with {:locale=>[:en].... I assume I need to make a simple change elsewhere so rails knows where to find the views however I have not been...

Enumerating executable files in C

c,unix,directory,ansi
I am trying to enumerate only files with the execute (+x) bit set. My code seems to list all files. It also seems to enumerate directory and the above directory which I do not want. Example: .. should_not_be_executable.sh . Is there a way to filter '..' and '.' without strstr()?...

Xcopy Script for Changing Directory

batch-file,directory,copy,xcopy
I'm currently trying to come up with a script to copy several files from one location to the operating location of a program and then launching the application. Currently I have this: xcopy /s /v /z "I:\test\20150520\Files\stmt" "C:\Users\test\Desktop\test2" PAUSE START C:\Windows\NOTEPAD.EXE This script seems to work without a problem but...

C# create dir in %AppData%

c#,directory
I want create directory (if not exist) in path AppData/Roaming/test. But my code doesn't work, I dont know why. Can you help me? string path; path = @"%AppData%\Roaming\test\"; path = Environment.ExpandEnvironmentVariables(path); Console.WriteLine(path); if (!Directory.Exists(path)) Directory.CreateDirectory(path); This code doen't create dir....

How to read all .txt files in a directory in C

c,file,directory
I currently have a short program to read and sort a text tile in C. If I want to read many files, is there a substitute for: FILE *f f = fopen("*.txt", "rw"); Thanks in advance....

Express and Angular directory structure

angularjs,node.js,express,directory,structure
I want to build a website with Express and Angular (no SQL) so I started wondering what is the right structure for this kind of app. For Angular there is a directory structre I really like from here: app/ ----- shared/ // acts as reusable components or partials of our...

r match filenames in two folders and perform code

r,file,directory,match
I have 2 folders with text files: Aba with 90 files and Baa with 50 files. I have a piece of code where I open files with same names from two folders and perform operation. dna_no= read.table("/home/Documents/Baa/112.txt",skip=1, header=TRUE, sep="\t", fill=FALSE) sim = read.table("/home/Documents/Data/Aba/112.txt",header=FALSE, sep="\t") then I want to perform code...

Trying to retrieve a directory list from a NAS server in my lan

ios,swift,directory,server,nas
I am new in swift and I try to find out how to retrieve a directory list from a NAS Server into my App. The NAS Server, MAC and iPAD are in my LAN. I searched for exactly that problem but could not find any hints and I am still...

Get number of files in various subdirectories relative to the current page - ColdFusion

coldfusion,directory,cfdirectory
I have some cf code which is almost working I think. I have the following structure: work --still-life --portraits --personal In each of these folders there is the same structure: still-life --img-s --img-m --img-l I want to know how many files are in the first directory (img-s) for each of...

Searching a directory, finding the last entered file name in C++

c++,file,winapi,mfc,directory
I am using Cfilefind library in C++, to get the name of the last entered file to the directory. In other word the file who entered the directory after the existing files. CFileFind finder; BOOL bWorking = finder.FindFile("*.png"); while (bWorking) { bWorking = finder.FindNextFile(); cout << (LPCTSTR) finder.GetFileName() << endl;...

Get last X files created from a directory (PHP)

php,file,directory
Im using this code to get the most recent file created: <?php $files = glob($siteRoot.'/dir/*/*.php'); $files = array_combine($files, array_map('filectime', $files)); arsort($files); echo key($files); ?> How can I enhance this to get the last 3 files created, or what ever number I need? Any help would be appreciated. Thanks!...

Ruby on Windows XP: How to change directory of SSL certificates

ruby,ssl,directory,certificate
I installed Ruby 2.0.0 on Windows XP, and run this script: # testSSL.rb require 'open-uri' open('https://www.google.com') I get a "certificate verify failed" error on http.rb line 921. Testing further, it seems that Ruby looks for the SSL certificates files here: C:/Users/Justin/Projects/knap-build/var/knapsack/software/x86-windows/openssl/1.0.1l/ssl How can I tell Ruby to look for these...

Attempting to link to root directory on home computer

php,html,directory,root
I'm attempting to build a website on my computer and I'm having issues linking with my root directory from anywhere on the website. I know I can use ../ to go up 1 directory as many times as needed, but I need a way to link to my root directory...

Watch a directory in python and parse latest generated text file

python,parsing,directory
I'd like to ask if there's any way we could watch a directory in python and parse the latest text file being generated on the directory. Tho i have this start up code which parse a certain text file. import time def follow(thefile): thefile.seek(0,2) while True: line = thefile.readline() if...

How to make a url virtual 'directory' based on unique Ids

php,html,.htaccess,directory
Lets start with an example: I want to do what Tumblr is doing. More specifically, every time you click on the 'reblog' button, the URL changes to something like "/reblog/UNIQUEID/UNIQUEID/". Yet obviously they don't have millions of directories with html files in each. So I was wondering, if I want...

How can i use .htaccess to point to a directory different from the one on the url bar

php,apache,.htaccess,mod-rewrite,directory
am stuck trying to use .htaccess to point to the template directory for users of my site. the directory where user is directed after login is mysite.com/lu/user1/ whereas the content i want to load is at mysite.com/lu/default/ what i want to achieve is load content from the default template directory...

Run linux command based on existing file in a directory

linux,bash,directory
In /dev/usb directory sometimes I have lp0 and sometimes lp1. How can I change the following command to change the --name based on the content of /dev/usb? I.e. if I have lp0 in the /dev/usb directory I get: TEST=`udevadm info --attribute-walk --name=/dev/usb/lp0 | grep "serial}==\"VL" | sed -n -e 's/^.*serial}==\"VL//p'...

How to automatically delete file older than 24 hours of a .pdf format in a specific folder with PHP

php,delete,directory,file-manipulation
I keep getting many pdf file in my directory root/files/pdfs. I want a PHP script to automatically delete only the .pdf files from the pdfs folder that are older than 24 hours (86400 seconds). What permissions will the .php file require? Where to put the file? Should I have to...

Thumbnails in media library not showing after upload path change

wordpress,upload,directory,media
After making these changes to change the folder for uploads I can no longer see thumbnails in my media library after uploading. Could anyone suggest a fix? Screenshot: http://take.ms/wtGMZ Steps I took to do it: http://www.hongkiat.com/blog/wordpress-custom-upload-dir/...

Linux directory starting with dot

linux,ubuntu,directory
Is there anything special about directories which start with a dot . in Linux (Ubuntu), such as ~/.vim? Thanks.

Open file in different directory

python,directory
I've written a function and I want to open a file in a subdirectory 'data'. def _save_exrates(date, rates): """ Saves the exchange rates data for date 'date' in the appropriate exchange rates file, as described below. """ file = open(os.path.join('data', 'rates-'+date+'.csv'), 'wt') w = csv.writer(file, lineterminator='\n') w.writerow(['Code', 'Rate']) for key,...

Using dirent->d_name together with string fails

c++,directory,dirent.h
I'm writing an C++ Application that uses the dirent.h library, to read files from a directory. At one point I want to decide between Files and directories. To achieve that I added the following piece of code: entry = readdir(used_directory); //read next object from directory stream DIR* directory_test =...

How to retrieve an icon of a file in Xcode (Cocoa)

objective-c,image,cocoa,directory,icons
I am creating a sort of the File Directory like a Finder in Xcode Cocoa Objc-C. I have created a collection view with many square buttons and each button opens up a different file located in the app. What I have done until now is populated each button with the...

Git: Remove directory with quotes and backslashes from repo

git,directory,repository,special-characters
I have a directory in my git repository (but not on my local system) named "my\\directory-name" It contains two quotation marks and two backslashes. The problem is that with this directory in my repo it is not possible to checkout the contents completely because (error message:) git doesn't find a...

Okta Api User Directory

api,directory,okta
Using the okta API, we're trying to display a simple staff directory. Basically we want to list all active users in a particular group on a web page. Seems like it should be super simple. If I use the user endpoint, I can get all users and filter by status...

include throws No such file or directory

c++,netbeans,directory,g++,cygwin
#include<apis/api1/api.h> throws No such file or directory i even tried moving api.h and api.cc to the main project directory and using #include<api.h> does the same thing even though it is in the exact same directory that the other classes use i tried adding /apis/api1 to the compiler search path that...

C programming getcwd variable manipulation [duplicate]

c,io,directory,getcwd
This question already has an answer here: How to get the current directory in a C program? 2 answers Basically I need an if statement of which the response is dependent upon the current working directory. I have done some research on the topic and I believe that the...

In Java, how do I check if something is a directory, and if not, throw an exception?

java,exception-handling,directory
I've created this new object: File dir = new File(userHome + "//data") In another class, I want verify that 'dir' is a directory and if it isn't, throw an IllegalArgumentException. My goal is to then locate specific file types in that directory (if a directory) and process them....

“Move will not work across volumes” - Why? And how to overcome?

c#,file,directory
Why is it that File.Move(sourceFileName, destFileName) works fine when the source file and destination files are in different partitions, but Directory.Move(sourceDirName, destDirName) don't? It throws System.IO.IOException: "Source and destination path must have identical roots. Move will not work across volumes." I even tried to create a DirectoryInfo instance and use...

Search a string without . character

c#,linq,search,directory
I'm stuck with a search file problem. I have a file say: 1346670589521421983450911196954093762922.nii that is referenced to the file below: 1.3.46.670589.5.2.14.2198345091.1196954093.762922.dcm The difference is that there are (.) placed in different positions. Does anybody know how to search for a file without the fullstop(.)? As i have to go through...

Checking the file existence in other directories

c,directory
I have been using access(file_name, 0) == -1 to check whether the user input file_name exists in the directory or not. But this method works in the current working directory. I wonder if there is a way I could know whether the file_name exists in another directory or not so...

Directory Concept in Oracle

oracle,directory
If we create a directory using create or replace directory and another directory exists which has the same path will the original directory get deleted?

Why does Cygwin repeat every command I type?

unix,directory,cygwin
Every time I type a command into cygwin, it repeats it, with a plus sign before it. It's not the biggest deal but it just bothers me. It looks like this: [email protected] /cygdrive/c/Users/Julian/dev $ mkdir play + mkdir play [email protected] /cygdrive/c/Users/Julian/dev $ ls + ls autoHotKey gitp1 play TopCoder.jnlp [email protected]..

Python - Long string on multiple line

python,file,directory
Is there a correct way to show file paths (hard coded) longer than 79 characters (based on pep8) on multiply lines or is it best to keep the file path on a single line? Eg photos = "D:\MyWork\FieldWork\Year2015\January\MountainPass\Area1\Site1\Campsite2\Inspections\photos1" Would the above example work best on multiple lines or a single...

How to check if a given path is a file or directory?

file,file-io,path,directory,rust
I'm building a program that should be able to take both paths to files (*.*), and directories (./, ..). I want to be able to check if the path supplied is a file, or a directory.

Generate TCPDF output to a shared drive folder

php,pdf,path,directory,tcpdf
I'm trying to save my PDF file to a "Shared Folder", I'm using a configuration file to set the "Shared Folder" and then I just set the path inside the PHP file. However it doesn't allow me to save with a "Shared Folder" path, it gives me the error: Failed...

How to access file from another application's directory on Bluemix?

r,directory,bluemix
This is my problem scenario : 1.Create 2 apps. 2.App1 continuously pulls tweets and stores the json file in its /data folder. 3.App2 picks up the latest file from the /data folder of App1 and uses it. I have used R and its corresponding build-pack to deploy the app on...

Create index.php file in directory [closed]

c#,file,directory,command-line-arguments
I want to write a program to be added to the right-click menu and when I run the program from the right-click menu to create an index.php file in current directory! Exmaple: I go to C:\wamp\www Then I right-click somewhere and want to choose create index.php This should create a...

File not found, even though the directory is correct

python,file,directory
I am currently trying to make a game, and I am importing an image for a button from a the same folder the python file is from. The method: dirname, filename = os.path.split(os.path.abspath(sys.argv[0])) imagepath = os.path.join(dirname, "redvase.png") vase1 = Button(root, relief=FLAT, background="white", image=imagepath) vase1.place(x=330,y=240,height=30,width=30) The output (imagepath) comes out as...

How do I link to a file in a different directory without using the whole address?

html,hyperlink,directory
I'm building a website on my computer's local server, with the plan to upload to my webhost with all the links and relative pathways intact. However, I've run into a problem with how to link to pages and images in directories higher up the hierarchy chain. For example, let say...

Directory.GetFiles not working and returning wrong value

c#,directory,console-application
Whenever I try to display the files in a directory the program only prints System.String[] instead of the files. Console.WriteLine(Directory.GetFiles(@"C:\")); Its really bothering me, because I havn't found anyone else with this problem. If you need an explanation, my program is meant to be a console like CMD, when I...

Powershell scrip to list Zip files in a Directory with their Size

list,powershell,directory,zip,size
I have came across a way to list Zip content in a Directory - I would like to include the file size information. [Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') foreach($sourceFile in (Get-ChildItem -filter '*.zip')) { [IO.Compression.ZipFile]::OpenRead($sourceFile.FullName).Entries.FullName | %{ "$sourcefile`:$_" } } Could someone help me to add size information - current display format is: zipName:zipContentName...

How do you get files with extension from folder in Ada95?

directory,folder,ada
I'm trying to create a function that will look for all .dll files in a specified folder, plugins. All of my web searches (Ada Directories) have work perfectly under Ada 2005, but I need a function that will work for Ada 95. It is to my knowledge that Ada 95...

how to write a file to a particular folder in java?

java,file,directory,bufferedimage
I did this program which takes screenshots using the robot class and bufferedimage class. The .png file which contains the screenshots is getting saved to the folder where the .java file is present.I want the image files to be written in another folder called screenshot which i created. I tried...

recursively get files and directories list in java

java,directory
I want get all files and directories list, and this is my code: package com.loiane.util; import java.io.File; import java.io.FileFilter; import java.nio.file.*; import java.util.ArrayList; public class ListFilesUtil { public static void getList(String dir){ File folder = new File(dir); File[] listOfFiles = folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++)...

Creating files from a list of csv in a directory

r,csv,directory,filelist
I have the folder "TEST AIS Florent/test division/division2014/testexport/testloop" with 4 csv files in it: testexport_1; testexport_2; testexport_3 and testexport_4. I would like to filter each file and export them to different csv: one for testexport_1, a second one for testexport_2, etc. For now, my script is rm(list = ls()) setwd("D:/TEST...

Python 3 filtering directories by name that matches specific pattern

python,regex,python-3.x,directory,filtering
Currently I'm developing script that will perform cleanup of specific directories. For example: Directory: /app/test/log contains many sub-directories with name pattern testYYYYMMDD and logYYYYMMDD What I need, is to filter out only directories like testYYYYMMDD To get all folders with absolute path that are in given directory I use: folders_in_given_folder...

Can't access other folders/directories with my XML program

xml,directory,location,folders,pathing
So right now I'm trying to access a certain file automatically through the browse function on my computer. This is what I have so far, but it only keeps me within the same folder as my file is in. How would I access another folder with this: <SupportedDevices> <Device VID="0x1234"...

ZF2 directory structure for lots of applications

php,zend-framework,zend-framework2,directory,structure
I'm learning ZF2 and I need some help. I am working in a company which has an intranet. We have lots of applications like newsletter, HR, website control, helpdesk, etc. Is it correct to put all the applications in the same ZF2 directory structure as if they were modules? Like...

Is there any way to copy a directory to another path using guava library?

java,directory,copy,guava
I know there is a method -Files.copy()- using guava library to copy a file, but what's the way to copy a directory in other path? P.S: this question maybe similar to this question but I'm wondering if there is any other way except copying files one by one.

A folder created with os.Mkdir() has incorrect permissions

go,permissions,directory
I am creating a folder in go using os.Mkdir(). While it does get created, it does not possess the permissions I expected it to. Here is the code I used to create the directory: package main import ( "fmt" "os" ) func main() { err := os.Mkdir("/var/run/testdir", 0777) if err...

Only conserve the name of the folder in a .txt file with a complete directory (Batch)

windows,batch-file,directory,folder,rename
(I DIDN'T DO A BATCH WITH THIS STUFF YET) I have a file called "worldcopy2.txt" which inside has a full directory: C:\Users\Robert\Desktop\myworld2 And I want to create a batch file to change the inside of the .txt to only have the name of the last folder of the directory that...

How are dirent entries ordered?

c,directory,dirent.h
I am at a loss as to how dirent entries are ordered. For example, if I had the code DIR* dir = opendir("/some/directory"); struct dirent* entry; while ((entry = readdir(dir)) printf("%s\n", entry->d_name); This may output something like the following: abcdef example3 .. . 123456789 example2 example1 As you can see,...

Python: Program will not run in other directory

python,directory,folder
I am running ubuntu 12.04 and running programs through the terminal. I have a file that compiles and runs without any issues when I am in the current directory. Example below, [email protected]:~/Documents/BudgetAutomation/BillList$ pwd /home/david/Documents/BudgetAutomation/BillList [email protected]:~/Documents/BudgetAutomation/BillList$ python3.4 bill.py ./otherlisted.txt ./monthlisted.txt [email protected]:~/Documents/BudgetAutomation/BillList$ Now when I go back one directory and try running...

How can I check if a string exists in any file within a directory / subdirectory?

python,bash,directory
I have a list of strings and I would like to print out any that are not present within a file in a directory. (I don't want to check the headers) I understand how to loop through the list, but have been unable to find out how to search within...

How to find out if a directory is under or above another directory in the file system hierarchy

java,algorithm,file,directory
I am currently working on a project which is an implementation similar to FTP. For this, I need to implement virtual chrooting, which should also work on Windows platforms. My current approach is that each user has a specific home directory (represented by a File object) and every time the...

'find' (command) finds nothing with -wholename

linux,bash,directory,find
Why does this command work: /home/user1/tmp $ find ./../.. -wholename '.*/tmp/file.c' -exec echo '{}' \; ./../../user2/tmp/file.c /home/user1/tmp $ And this command does not work? (finds nothing) /home/user1/tmp $ find /home -wholename '.*/tmp/file.c' -exec echo '{}' \; /home/user1/tmp $ ...

pathForDirectory method for NSBundle?

ios,path,directory,folder,nsbundle
If I include a folder in my bundle (a real folder, the blue ones, not the yellow groups), how can I get the path for that folder from my bundle? The method I would usually use is... [[NSBundle mainBundle] pathForResource:fileName ofType:______]; ...but what "type" is a directory? Is there a...

How to pass json directory to the template within the django framework?

json,django,d3.js,django-templates,directory
I am new to D3 and django and I hope to combine them for visualization. I download one code example of D3, and it needs the json file as data source. I then write a template in Django like: ` .link { stroke: #ccc; } .node text { pointer-events: none;...

Creating a directory and inserting another director inside that directory in PHP

php,directory
I have a directory on my root called profiles. I want to add another dir into that and another inside that something like this profiles > jack > user_images $username_entry = "jack"; $user_image_dir = "user_images"; mkdir(profiles."/".$username_entry, 0777, true); mkdir(profiles."/".$username_entry."/".$user_image_dir, 0777, true); But i dont think this is the correct way...

How can I load an image from a local directory in PHP?

php,image,directory,load
My setup (or path) is as follows: |Home |ftpUsername |assets |images.png |script.php |mydomain.com |index.php index.php is located in mydomain.com, which includes script.php in /home/ftpUsername/assets without a problem. script.php is included in index.php using the include() function. My question is, how can I get PHP to load the images (png format)...

How do i go to parent directory when using __dirname?

javascript,node.js,directory,gulp,gulp-karma
Directory structure : WebApiRole GulpFile.js test Karma.conf.js Gulp code from GulpFile.js gulp.task('test', function (done) { karma.start({ configFile: _configFile: __dirname + '\\..\\test\\karma.conf.js', singleRun: true }, done); }); So my problem going to the parent directory and access the karma.conf.js . For some reason the path is not get resolved with ..\\...

Error allocating file install folder in WIX 3.9

directory,wix,windows-installer
I am setting up the installation locations for my installer. However, it throws an error when I try to set the locations. Source code: <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="Wix_setup" Language="1033" Version="1.0.0.0" Manufacturer="Frank Jansen" UpgradeCode="37a42e55-dea8-47da-8f4f-fb065dd38a9e"> <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> <MajorUpgrade DowngradeErrorMessage="A newer version of...

Determining the Parent Folder of a given Path in C#

c#,file,directory
pages/parentdirectory/directory how can I extract the parent directory in C# ?...

How do I check if file name is a directory or not in C?

c,directory,directory-structure
I'm using if(strstr(dir->d_name, ".") == NULL && strstr(dir->d_name, "..")to check if its a directory/subdirectory, but this is still printing out some files that are not directories...Im using the direct struct and DIR.

R - run system call with space in path on Mac

r,osx,directory,space
I am trying to invoke some system commands on R using system() calls. However, I am having the infamous problem with spaces in the directories. For example, I am trying to use this directory: odir <- '/Volumes/Macintosh HD 2/data/cmip5/historical/clt/models' on this command: system(paste('ls ', odir,sep='')) and I receive the following...

How to create directories and sub directories efficiently and elegently in Python 2.7?

python,python-2.7,directory,directory-structure,python-os
I am trying to create a bunch of directories and sub directories at a specific location in my PC. My process is something like this: Check if there's any directory with the same directory name. Skip if so. If not, create the directory and the pre-defined sub directories under that...

Phalcon PHP - Multiple views directories

php,directory,views,phalcon
I'm having problem with my Phalcon PHP project. I'm building single module app with multiple MVC directories inside. Every each module has it's own "views" directory, which contains action templates. (index.volt, show.volt etc.). Layouts are loaded from modules/layout/ and then set with $this->view->setLayout('index'); in main controller initialize(). That's how it...

How to create a text file inside a folder on the desktop using batch

batch-file,text,directory
I am trying to get a batch file to create a folder on the desktop with a text file inside of it. Every-time i try to run this line of code it gives my the error that "The filename, directory name, or volume label syntax is incorrect." echo ======================== ::CREATE...

How do I copy a file thant contains random filename

php,file,ftp,directory
How do I copy files in a directory with filename contains.. see sample below file_123_XXXXXX.zip where XXXXXX is a random numbers.. I want to copy file_123_XXXXXX.zip from server to same file name to my local folder the code is working operational if I set the filename exactly the same in...

PHP scan directory and array

php,arrays,directory
I have a script that scans a folder and put in an array the file names it contains. Then I shuffle the array and display the file names. Like this: $count=0; $ar=array(); $i=1; $g=scandir('./images/'); foreach($g as $x) { if(is_dir($x))$ar[$x]=scandir($x); else { $count++; $ar[]=$x; } } shuffle($ar); while($i <= $count) {...

Add images to Oracle Database

oracle,stored-procedures,directory
Hello I am trying to add images to table. I made table: CREATE TABLE program_images ( image_id NUMBER, image_filename VARCHAR2(50), image BLOB ); Then made directory where All images are: Finaly made procedure, which insert images to table: create or replace PROCEDURE insert_image_file (p_id NUMBER, p_image_name IN VARCHAR2) IS src_file...

How to write(save) files to a directory instead of desktop?

python,directory
Here is my code: f = open("myfile.txt") f.write("Writing something") f.close() plt.savefig('plot1.png') plt.savefig('plot2.png') workbook = xlsxwriter.Workbook('results.xlsx') workbook.close() At the moment, these files are being saved to my desktop. How would i save them to a file that the user specifies the name for? So i would have a widget like so:...

PHP - Find File in Directory By File Name [closed]

php,select,directory,filenames
I have a directory full of filenames that contain unix timestamps. file_1434320602.data file_1434320352.data file_1434320112.data file_1434320032.data How would I get about loading them up in PHP so that I can select the one which I needed?...

How can we remove on server from Directory in OpenLdap?

security,directory,openldap
We installed a OpenLDAP 2.4.31 solution on debian; and several machines in the site are using it. Though the local authentication is not disabled on the machines. One of the machines has some problems; and its developers asked us to disable central authentication for it. Due to policy, we are...

Why can't C++ find GLM headers?

c++,opengl,directory,directory-structure,glm
I do not have permissions to put GLM into usr/local/include or usr/include but I need to use GLM for openGL. The code (I am not able to change) looks for GLM like this: #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> the folder glm is in the same directory as my main.cpp...

How to create a new directory from Force Fortran 2.0

directory,fortran,create-directory
I need to create a new directory from my code to be able to write a data file to it. I am using Force Fortran 2.0 from Windows 8 and I am also wondering if this syntax is going to vary from one operating system to the other due to...

Linux server with . and .. directories

linux,unix,directory,root,hidden-files
Why does each folder directory in my linux server has . and .. directories with same files ? is it user error or by design ? Example: I have folder bladelogic with list of these files along with . and .. directories which contains same files. ...

How to set a Directory as an Argument in Bash

bash,variables,ubuntu,directory
I am having trouble finding out how to set a directory as an argument in bash. The directory I am trying to have as an argument is /home/rrodriguez/Documents/one. Anywhere I try to look for an answer I see examples like dir = $1 but I cant seem to find an...

Why do conditionals inside of an event listener not work?

javascript,html,image,directory
When I have the conditionals inside of an event listener inside of a function, they don't seem to work properly [I commented them in]. In fact they don't work at all, but when I delete the conditionals everything works (except it works incorrectly because I need the conditionals) I'm a...

PHP Delete a file into a folder

php,html,directory
I'm trying to delete specific file name into a folder depend of the action of the user and I receive this warning: Warning: unlink(): http does not allow unlinking in This is the code that have the button that provide the navigation to the deleteRecord.php > <script> //btn delete >...

Create Directory From Brother Directory

directory,mkdir
My directories have the following Format: Inside the home directory, there are two directories: archive and production. While inside the production directory I want to write a command to make a directory inside the archive directory. Whats the best way to do this? Thanks in advance...

URL Directory as parameter

php,.htaccess,url,directory,param
I would like to turn a URL directory into a parameter. How can this be done? For Example myurl.com/directory1/?param2=test1 myurl.com/directory2/?param2=test2 myurl.com/directory3/?param2=test3 to reflect this myurl.com/index.php?param1=directory1&param2=test1 myurl.com/index.php?param1=directory2&param2=test2 myurl.com/index.php?param1=directory3&param2=test3 htaccess solution would be great. Thanks!...

JFileChooser won't allow selection of directories

java,directory,jfilechooser
I want to use a JFileChooser in my program in order to choose a directory and process it. However, no matter what FileFilter I use for the file chooser, the Open button is locked when a directory is selected. Below is the code of my FileFilter. this.fileChooser.setFileFilter(new javax.swing.filechooser.FileFilter() { @Override...