directory

Adding java folders to android studio project

≯℡__Kan透↙ 提交于 2019-12-18 03:55:10
问题 Started working on my first project using Android Studio instead of Eclipse ADT . I would like to add sub folders to contain java.classes in order to structure my app but are unable to obtain references to them in my activity structure is (with app name replaced) src/main/[MyCompany]/[myAppName]/model/user.java and src/main/[MyCompany]/[myAppName]/helperClasses/SQLiteHelper.java however I am unable to reference them either directly in code or by import, and are forced to put them in the

How can i improve my function for handling alternative to Application.FileSearch VBA

佐手、 提交于 2019-12-18 03:46:47
问题 I have decided to attempt a UDF around alternative to Application.FileSearch. I assume a few locations where a file COULD be located. Solutions on the internet tend to assume the user generally knows where the file is located, this assumed it could be anywhere, EDIT: Alot of solutions on the internet are long winded and i believe it should be much more efficient, hence using this post as a means of a discussion as to how this can be achieved Please note, I have replaced the path directories

Find directory for “application data” on linux and macintosh

廉价感情. 提交于 2019-12-18 03:16:10
问题 I have a game engine based on LWJGL, and to run it I need to place the required native libraries onto the user's computer. On Windows, I do so by finding the Application Data directory via: System.getenv("APPDATA"); and everything works easily and nicely. I create a File object, call mkDir if necessary, and write the files if they are not already on the machine. (Note: the created directory should not be a temporary file, as I would like to save the extracted files for future runs.

How to determine the OS path separator in JavaScript?

我的梦境 提交于 2019-12-18 03:00:26
问题 How can I tell in JavaScript what path separator is used in the OS where the script is runnning? 回答1: Afair you can always use / as a path separator, even on Windows. Quote from http://bytes.com/forum/thread23123.html: So, the situation can be summed up rather simply: All DOS services since DOS 2.0 and all Windows APIs accept either forward slash or backslash. Always have. None of the standard command shells (CMD or COMMAND) will accept forward slashes. Even the "cd ./tmp" example given in a

os.path.getsize Returns Incorrect Value?

元气小坏坏 提交于 2019-12-18 01:03:30
问题 def size_of_dir(dirname): print("Size of directory: ") print(os.path.getsize(dirname)) is the code in question. dirname is a directory with 130 files of about 1kb each. When I call this function, it returns 4624 , which is NOT the size of the directory...why is this? 回答1: This value (4624B) represents the size of the file that describes that directory. Directories are described as inodes (http://en.wikipedia.org/wiki/Inode) that hold information about the files and directories it contains. To

Linux下FTP命令的使用方法

倖福魔咒の 提交于 2019-12-18 00:44:04
FTP> ? 显示 ftp 命令说明。? 与 help 相同。 格式:? [command] 说明:[command]指定需要帮助的命令名称。如果没有指定 command,ftp 将显示全部命令的列表。 FTP> append 使用当前文件类型设置将本地文件附加到远程计算机上的文件。 格式:append local-file [remote-file] 说明:local-file 指定要添加的本地文件。 remote-file 指定要添加 local-file 的远程计算机上的文件。如果省略了 remote-file,本地文件名将被用作远程文件名。 FTP >open 与指定的 FTP 服务器连接。 格式:open computer [port] 说明:computer 指定要连接的远程计算机。可以通过 IP 地址或计算机名称指定计算机(DNS 或主机文件必须可用)。如果自动登录打开(默认),ftp 还将尝试自动将用户登录到 FTP 服务器port 指定用来联系 FTP 服务器的端口号。 FTP >prompt 切换提示。如果关闭提示时 mget 及 mput 传送所有文件,Ftp在多文件传送过程中将提示允许您有选择地检索或存储文件。默认情况下,提示是 打开的。 FTP >put 使用当前文件传送类型将本地文件复制到远程计算机上。 格式:put local-file [remote

Directory Listing based on time [duplicate]

有些话、适合烂在心里 提交于 2019-12-17 23:39:34
问题 This question already has answers here : How do you get a directory listing sorted by creation date in python? (16 answers) Closed 6 years ago . How to list the files in a directory based on timestamp? os.listdir() lists in arbitrary order. Is there a build-in function to list based on timestamp? or by any order? 回答1: You could call stat() on each of the files and sort by one of the timestamps, perhaps by using a key function that returns a file's timestamp. import os def sorted_ls(path):

How to find out if the NSURL is a directory or not

怎甘沉沦 提交于 2019-12-17 23:25:16
问题 I have a NSURL object. It has address of a filesystem element, it is either a file or a directory. I want to be able to tell if the NSURL is a directory or a file. I have already tried this, which doesn"t seem to work! NSURL * temp ....... ;// it is initialized and has a valid value CFURLRef xx = (CFURLRef)CFBridgingRetain(temp); if(CFURLHasDirectoryPath(xx)) NSLog(@"was a file"); else NSLog(@"was a folder"); 回答1: NSNumber *isDirectory; // this method allows us to get more information about

Check if directory is empty in Ruby

杀马特。学长 韩版系。学妹 提交于 2019-12-17 22:57:37
问题 How can I check to see if a directory is empty or not in Ruby? Is there something like: Dir.exists?("directory") (I know that that function doesn't exist.) 回答1: Ruby now has Dir.empty?, making this trivially easy: Dir.empty?('your_directory') # => (true|false) In Rubies prior to 2.4.0 you can just get a list of the entries and see for yourself whether or not it's empty (accounting for "." and ".."). See the docs. (Dir.entries('your_directory') - %w{ . .. }).empty? # or using glob, which doesn

Copy files from a folder of SD card into another folder of SD card

ⅰ亾dé卋堺 提交于 2019-12-17 22:34:26
问题 Is it possible to copy a folder present in sdcard to another folder present the same sdcard programmatically ?? If so, how to do that? 回答1: An improved version of that example: // If targetLocation does not exist, it will be created. public void copyDirectory(File sourceLocation , File targetLocation) throws IOException { if (sourceLocation.isDirectory()) { if (!targetLocation.exists() && !targetLocation.mkdirs()) { throw new IOException("Cannot create dir " + targetLocation.getAbsolutePath()